I just installed passenger (apache2) on my ubuntu server to deploy my rails 3.1 rc4 rails app into the wild, and wanted to change from sqlite to mysql.
I installed the necessary ubuntu packages
I updated my Gemfile with the recommended:
gem 'mysql2'
And updated my database.yml file
production:
adapter: mysql2
database: database
username: deploy
password: (***blocked for security reasons***)
socket: /var/run/mysqld/mysqld.sock
pool: 5
timeout: 5000
When I try to create the production database with rake:
rake db:migrate RAILS_ENV=”production” --trace
It gives me a bunch of crazy errors
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
”production” database is not configured
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord- 3.1.0.rc4/lib/active_record/connection_adapters/abstract/co开发者_运维问答nnection_specification.rb:62:in `establish_connection'
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.1.0.rc4/lib/active_record/railtie.rb:69:in `block (2 levels) in <class:Railtie>'
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.0.rc4/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.0.rc4/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/local/rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.1.0.rc4/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
(And so on)
I have tried install the regular mysql gem, which also didn't work. I have also tried <0.3 of mysql2, but that seemed to lead to an error being thrown complaining about using versions 0.2 with rails 3.1 rc4
I am really stumped :/
have you tried without the quotes around "production" ?
RAILS_ENV=production rake db:migrate
精彩评论