Rails 3 on Dreamhost via Capistrano

Dreamhost has started rolling out Rails 3.0.3 to its servers; however, there’s a couple of snags that may prevent you from quickly and easily deploying a Rails app. I’ve spent the better part of a couple of hours overcoming these challenges, some of which might have been due to me climbing the Rails 3 deployment learning curve. I was running into all kinds of problems with “500 Internal Server Error”, as well as being unable to get the required gems installed properly, including the required native extensions.

Allow me to save you some time.

First problem: the bundle executable isn’t in your PATH environment by default, either for login shells or non-login shells. The fix is simple – just add the right path to your .bashrc and .bash_profile: export PATH="/usr/lib/ruby/gems/1.8/bin:$PATH"

Second problem: you need to make sure to use bundle install properly to resolve and install your dependency gems. Simplest solution is to add require 'bundler/capistrano' to the top of your deploy.rb.

Those two small additions will resolve problems deploying Rails 3 apps via Capistrano on Dreamhost. Happy coding!

2 thoughts on “Rails 3 on Dreamhost via Capistrano

  1. Thanks for posting this. I’ve been upgrading an app to Rails 3 and I hadn’t even started to think about deployment.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>