2011-05-22 86 views
1

我試着運行耙分貝:創建一個MySQL數據庫,但得到的錯誤導軌 - 耙分貝:創建錯誤

$ rake db:create 
rake aborted! 
undefined method `task' for #<Sharebox::Application:0x0000010085a010> 

伊夫運行--trace並獲得信息

/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing' 
/Users/lucasdobbins/rails_projects/sharebox/Rakefile:7:in `<top (required)>' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:59:in `run' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/bin/rake:31:in `<top (required)>' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/bin/rake:19:in `load' 
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/bin/rake:19:in `<main>' 

這是我的database.yml文件

development: 
    adapter: mysql 
    encoding: utf8 
    reconnect: false 
    database: sharebox_development 
    pool: 5 
    username: root 
    password: 
    host: localhost 

伊夫重新安裝紅寶石,導軌和MySQL,但仍然得到同樣的錯誤任何幫助,將不勝感激。歡呼聲

回答

6

您應該在您的GemFile中精確定位您的Rake版本。

Rake 0.9剛剛出來,但打破了Rails。

這裏的dhh鳴叫:

Rake 0.9,released yesterday, broke Rails (and others). While we wait for a fix, you'll want gem 'rake', '0.8.7' in your Gemfile.

嘗試嗎?

編輯:另外,如果您真的需要Rake 0.9而不是Rake 0.8.7,請參閱that post。也許這種解決方案會爲你工作。

+0

感謝您的幫助,這降低了工作,乾杯 – led 2011-05-25 03:22:32