Im a Rails beginner and am using Rails 3 on Ubuntu 10.10. My database.yml is as follows.
development:
adapter: mysql
database: project_dev
username: root
password: rootpassword
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: project_test
username: root
password: rootpassword
host: localhost
production:
adapter: mysql
database: project_production
username: root
password: rootpassword
host: localhost
Then i switched to the project folder and ran the command:
rake db:create
But,only the project_dev and project_test databases were created. The project_production database did not exist in mysql. What could the problem here ?
Please Help Thank You
That is the way it is intended to be. To create the production database do:
RAILS_ENV=production rake db:create
Also, have a look at rake db:setup
which will run anything you put in db/seeds.rb
.
This is by design as @iain suggests. To create all databases, run rake db:create:all
.
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