views:

35

answers:

2

I'd like to start the rails console and create database entries in a database that isn't the default database, such as the testing database. I'd appreciate any help.

A: 
$ RAILS_ENV=test ./script/console
MBO
+2  A: 

To start console in test environment:

ruby script/console test 
ruby script/console production 

To run rake tasks in test environment:

rake db:create RAILS_ENV=test 
rake db:migrate RAILS_ENV=test 
KandadaBoggu