I’m starting learning Ruby on Rails. So my application, like every Rails app, has three databases:
- Development
- Test
- Production
And the question is: how do i switch from a db to another?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default whenever you do “ruby script/server” you are going to be running against the development database.
Any time you run tests, by doing “rake test”, “rake test:functionals”, etc, Rails will automatically load up anything you have in your fixtures into the test database and use that.
Whenever you deploy into production, if you use Phusion Passenger (which you probably should), it will by default run your app in production mode.
If you want to start up your webrick server against one of the other databases, you can do: