Switching Ruby on Rails databases -


I am starting to learn ruby ​​on the rail. Therefore, my app has three databases like every rail app:

  • Evolution
  • Test
  • Production

And the question is: How do I switch from DB to another?

Thanks

By default whenever you do "ruby script / server" So you are about to run against the development database.

By doing "rake test", "rake test: function", etc., the rail will automatically load anything in your fixtures and use it in the test database.

Whenever you deploy to the production, if you use a Fusion passenger (which you may want), by default your app is run in production mode.

If You want to start your web browser from one of the other databases You can do this:

  & gt; Ruby script / server -E production> Ruby script / server -E exam  

Comments