Mac Os rake db:用qt和mysql依赖创建错误

时间:2012-07-11 15:51:50

标签: mysql ruby macos qt rake

我有这样的问题,当我尝试创建数据库时,虽然有错误但是有轨 我尝试重新安装mysql,但坚持使用brew

设置版本
Aleksandrs-MacBook-Air:alfred_infocus sharkzp$ rake db:create --trace
:public is no longer used to avoid overloading Module#public, use :public_folder instead
    from /Users/sharkzp/.rvm/gems/ruby-1.9.3-p194/gems/resque-1.8.2/lib/resque/server.rb:11:in `<class:Server>'
** 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!
undefined method `values_at' for "brew install qt# MySQL.  Versions 4.1 and 5.0 are recommended.":String
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:603:in `configs_for_environment'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:40:in `block (2 levels) in <top (required)>'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/sharkzp/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `load'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194@global/bin/rake:19:in `<main>'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/Users/sharkzp/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:create

我有这样的版本 mysql - 5.5.25a qt - 4.8.2

1 个答案:

答案 0 :(得分:0)

我不确定qt brew包与ruby,rails和数据库有什么关系?

但是来自ActiveRecord 3.2.11:

ActiveRecord::Base.configurations.values_at(*environments).compact.reject { |config| config['database'].blank? }

看起来这是尝试从配置加载数据库,可能来自config / database.yml。

您是否留下了文本“brew install qt #MySQL。建议使用版本4.1和5.0。”在yaml里面使它无效?

否则,Ruby YAML解析器可能会以某种方式被破坏。