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
March 19, 2007 at 8:03 am
the new public directory was great simple advice. Thankyou.
March 19, 2007 at 12:20 pm
Glad I could help. I hope I’ve saved you a couple of bruises on your head.
March 25, 2007 at 11:23 am
[...] Ruby on Capistrano on Dreamhost on Rails Ruby on Capistrano on Dreamhost on Rails (tags: ruby rails dreamhost capistrano) [...]
May 21, 2007 at 1:12 pm
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
May 21, 2007 at 4:36 pm
Wow! amazing article Jason, thanks for putting this up!
June 13, 2007 at 9:11 pm
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.
June 13, 2007 at 9:14 pm
I’m thinking about creating a “cap deploy, it’s a joy” t-shirt
thanks for the comment Frank!