我剛剛安裝了RVM,JRuby,Rails和MySQL,但是我在創建數據庫時遇到了一些麻煩。當我運行rake db:create --trace
我得到以下的輸出:rake db:create not working with mysql database(OS X)
rake db:create --trace
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
rake aborted!
uninitialized constant Mysql::Error
/Users/max/.rvm/gems/jruby-1.6.4/gems/activerecord-3.0.8/lib/active_record/railties/databases.rake:64:in `create_database'
/Users/max/.rvm/gems/jruby-1.6.4/gems/activerecord-3.0.8/lib/active_record/railties/databases.rake:33:in `(root)'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:205:in `execute'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/Users/max/.rvm/rubies/jruby-1.6.4/lib/ruby/1.8/monitor.rb:191:in `mon_synchronize'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:90:in `top_level'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:62:in `run'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/max/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2/bin/rake:32:in `(root)'
/Users/max/.rvm/gems/jruby-1.6.4/bin/rake:19:in `load'
/Users/max/.rvm/gems/jruby-1.6.4/bin/rake:19:in `(root)'
Tasks: TOP => db:create
我不知道什麼可能是錯誤的。有沒有人有任何想法?
你有在Gemfile中mysql的寶石和你運行'束install'? – drummondj
http://infinite-sushi.com/2010/07/uninitialized-constant-mysqlerror-with-rails-3/ –