Deploying Rails Applications

Deploying Rails Applications

  • A Step-by-Step Guide
  • Ezra Zygmuntowicz, Bruce Tate and Clinton Begin
  • Programming

Before I even wrote a Rails application I wondered exactly how this would be run on a remote server. Especially a shared server that you didn’t even have command line access to. The first Rails book that I read didn’t really cover that aspect in any great depth as I recall. So, I constantly thought exactly how would this work. If I wrote a great application would I have to pay big bucks just to get it working.

Up until now I think I have spent much more time getting Rails to work on a remote server than doing any actual coding.

I tried getting getting Rails to work on Bluehost, which at the time, didn’t work. Then I had a Mephisto site running on TextDrive using Lighttpd, which did work, but I really didn’t know enough about what was involved as I had just blindly set it up using the instructions they provided. Now I’ve switched to SliceHost, I set-up the slice using the Deprec gem, then had trouble using Capistrano and Subversion to deploy an application. So I set-up another slice and transferred things over. Now I have an application, that only I use, which was running Apache2 and a Mongrel Cluster but is now running Apache2 and Phusion Passenger™ (a.k.a. mod_rails/mod_rack). It’s no wonder that I’ve only just started to move about Rails development.

To be honest, it’s all good fun. Except when things don’t work the way you expect and you have no idea why. If you are developing Rails applications, even like me as more of a hobby, then you need to know about the environment that it’s going to be running on.

This book covers it all from hosting, shared, virtual and dedicated, to Capistrano set-up, which you will certainly need to understand to remove deployment headaches. Then it covers Mongrels, Apache2 and nginx and even has a section on deploying to Windows, for those who like pain or simply don’t have a choice. There are also chapters on clustering MySQL, database sharding and performance benchmarking.

Because the book was only released this year it doesn’t cover mod_rails. From a recent Web 2.0 Show podcast that Ezra was on I can understand why the book had to be rewritten three times, just to keep up with the latest advances in hosting environments.

It is a book I wish I had either bought sooner, or that it had been released earlier. At least now I have a book that I can use as a guide. I still want to aim to have either a slice, or an S3 instance that is running nginx, mongrel cluster with monit and that’s all.

Everything that you wanted to know about Rails deployment… but was afraid to ask.