How do I force Capistrano deployed app to use my development database?
-
05-07-2019 - |
Question
I have a app that I'm deploying to a development server using Capistrano. I'd like to force this deployment to use the development database. So far the only way I've managed to do it is to make my production database info in database.yml
equal to the development info. But this is a complete hack.
I've tried setting rails_env
to development in deploy.rb
but that hasn't worked.
Thoughts?
Solution
I ended up using the solution over here. Basically a recipe to replace a line in environment.rb after deploy but before restart.
The problems seems to be with DreamHost's Passenger config. It assumes you're running in production mode.
OTHER TIPS
I'd use Capistrano Ext in order to define multiple deployment environments. I have used this in the past to deply staging and production installations of my apps, so I think it'd work well for you.
Jamis Buck has a writeup if you'd like an overview on how to use it.