Ruby on Capistrano on Dreamhost on Rails

After working for a couple of days on an upcoming web service (more on this shortly), I needed to install it on my Dreamhost account. It was the first time I deployed a Rails app and expected to be somehow painful since I’ve only been using FastCgi and Apache for no longer then a year now.

But googling some random terms I bumped into this page. I’ve red about Capistrano before and decided to fell the pain upfront rather then in the long run.

But first of all, if you’re thinking about doing this, the best place to look is on the Dreamhost’s wiki, that’s all where my problems ended.

Deploying is pretty easy:


gem install capistrano
cap -A .
edit config/deploy.rb (following those instructions)
svn ci
cap setup
cap deploy

So easy that you think to yourself: wont work that was too easy. Well… you’re right.

FastCGI: incomplete headers (35 bytes) received from server

Had this error on my error.log file and knocked my head on the keyboard for almost 2 hours.

Again, Dreamhost wiki to the rescue, I ran rails tmp_app on my DH shell, replace the public directory by the new generated one (rm ~/mydomain.com/current/public; mv tmp_app/public ~/mydomain.com/current) and downloaded the public/dispatch.fcgi and .htaccess to my local app, committed, redeployed and jumped of joy!

But all the pleasure comes from subsequent deployments:

cap deploy

And done!

7 Comments

Filed under rails, ruby

7 responses to “Ruby on Capistrano on Dreamhost on Rails

  1. Nick

    the new public directory was great simple advice. Thankyou.

  2. Glad I could help. I hope I’ve saved you a couple of bruises on your head.

  3. Pingback: james dot schumann » links for 2007-03-25

  4. I added to your process by implementing some custom tasks to move over the ‘new’ .htaccess and dispatch.fcgi files when deploying. I have also incorporated some other ideas I found around. Just thought you might be interested. Thansk for your information!

    http://blog.jasonharrelson.com/2007/5/20/using-capistrano-to-overcome-deployment-hurdles-on-dreamhost

  5. Wow! amazing article Jason, thanks for putting this up!

  6. Setting up capistrano on my shared host was a real nightmare. I got every kind of errors one can think of. But, once it worked, I was amazed to realize how wonderful this thing really is.

    the words “cap deploy” and “cap deploy_with_migrations” are music to my ears.

    Capistrano is awesome.

  7. I’m thinking about creating a “cap deploy, it’s a joy” t-shirt

    thanks for the comment Frank!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s