我刚刚安装了RVM,JRuby,Rails和MySQL,但我在创建数据库时遇到了一些麻烦。当我运行rake db:create --trace
时,我得到以下输出:
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
我不知道出了什么问题。有没有人有任何想法?
答案 0 :(得分:2)
问题可能出在Mysql版本和gem标志中。如果你有(Mysql 5.1是一个稳定的版本)
,删除Mysql 5.5在这里查看rake aborted! uninitialized constant Mysql2和http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/