3

我有这样的问题,当我尝试创建数据库时,尽管出现错误,但我尝试重新安装 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

4

1 回答 1

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 解析器可能会以某种方式损坏。

于 2013-09-17T11:12:59.380 回答