I work on Ubuntu developing a Rails app for my church. We use a hosted VPS also on Ubuntu. I use Capistrano to deploy periodic updates. Inevitably, however, an app that works on my local box, always has a handful of problems after deploying to the host, most likely because the environments differ.

What are some practices/techniques to ease deployment so that what is tested and works locally is just as likely to work on the host. (I have already adopted the "vendor everything" approach.)

My first thought is to develop/work within a local VPS image that itself will eventually be deployed (a virtual appliance of sorts). Is anyone doing this?

What do others do to minimize issues that result from environmental differences? What hosts provide the best deployment options?


Can you give some examples of problems you have encountered? Are you freezing Rails and your gems into your application?

Written by nfm

I finally fixed everything but it was a 12-hour day (probably a 1 hour job for a deployment guru). I was upgrading from RadiantCMS (0.6.4 to 0.8.1) which itself appears in the vendor directory and has Rails in its vendor directory.

Written by Mario

Accepted Answer

As far as possible make sure you're running the exact same version of Ruby, the exact same version of Rails, the exact same database setup, and the exact same everything else. The more differences between your live setup and your development setup, the more problems you're likely to encounter.

Written by Dominic Rodger
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki