Rails Deployment Gotchas: Random Notes From the Whiteboard
This is an odd list of things that tripped me up at one point or another during Rails app deployment. They've been living on the whiteboard next to my desk for a while; now it's time to set them free.
App URL in Apache vhosts config is missing the .com. The requests to this url go to the next available application configured in vhosts. Symptom: accessing your newly launched app actually gives you some other app you have hosted on the same machine.
Apache listener is configured on the same port as another Rails app. Symptom: don't remember exactly, but I think Apache fails to start.
gem names case-sensitive in deployment environment (Linux), not in development environment (Windows -- this is from the dark days when I was developing on Windows). Symptoms: 1) can't install the gems you need; 2) free-floating mac envy.
reverse slash in 'require' works in development but causes error in production -- another Windows/Linux gotcha.
Rake gotcha: one missing include breaks all other tasks and everything fails silently.
Failure to clear out existing sessions after major rework and deployment. Symptoms: things failing with no reasonable explanation; pointed pangs of stupidity when you realize that you refactored stuff you store in session. rake db:sessions:clear.
rake not defaulting to production environment on production systems. This was a while ago, but it tripped me up a few times.
gems you installed in dev, but forgot to install in production.
There, now I can reclaim that space on my whiteboard . . .

Comments
topher on Nov 07
rake not defaulting to production environment on production systems
This tripped me up too. I ran rake db:migrate and it was successful. However, there were errors in the site. I should have run rake db:migrate RAILS_ENV=production. I didn't know there was a development database in the server.