2010-12-09 11 views
21

I rails acemi ve Ubuntu 10.10 Rails 3 kullanıyorum. Benim database.yml aşağıdaki gibidir. Üretim veritabanı, komisyon db tarafından oluşturulmamış: komutu yarat.

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 

Sonra ben proje klasörüne açık ve komutu çalıştırılmadan:

rake db:create 

Ama sadece project_dev ve project_test veritabanları oluşturuldu. Project_production veritabanı, mysql'de mevcut değildi. Burada sorun ne olabilir?

Lütfen Yardım

You olması amaçlanmıştır yoldur

cevap

57

ederiz. Üretim veritabanı oluşturmak için yapın:

Ayrıca
RAILS_ENV=production rake db:create 

, sen db/seeds.rb koymak şeyi çalışacak rake db:setup de bakabilirsiniz.

5

Bu, @iain önerileri olarak tasarım gereğidir. Tüm veritabanlarını oluşturmak için rake db:create:all'u çalıştırın.

+0

Bu da geliştirme ve test veritabanları yaratacaktır. – Chip

İlgili konular