With Ruby on Rails, when you reset or re-seed the database using rake db:seed or db:reset - how do you dictate which mode (development/test/production) the operation is to be in?
I'm using Sqlite for development, and postgresql for both test and production - but with different connection arguments. I do not seem to be able to control which mode Rails runs on on my development box (I'm running in a virtual machine, Ubuntu 13.l0) nor when on Heroku.
Also, how do you dictate which mode (development/test/production) to run your app in, when running it on Heroku? The way that Heroku's document suggests, does not work (that is, putting into the Procfile a single line with web: bundle exec unicorn -p $PORT -E $RACK_ENV and including a .env file that has RACK_ENV=test (for example). ? Thank you for any help. I am really hating Ruby-on-Rails.
You can set environment with RAILS_ENV env variable, for example:
RAILS_ENV=production bundle exec rake db:seed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With