我決定閱讀本教程。我創建了一個新的應用程序和應用程序目錄添加新的user:string email:string
,然後執行rake db:migrate
後,我得到這樣的輸出:爲什麼我不能獲得rake數據庫:遷移到ruby.railstutorial.org工作
rake aborted!
undefined method `task' for #<DemoApp::Application:0x00000100e49e08>
/usr/local/rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/usr/local/rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/usr/local/rvm/gems/[email protected]/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/Users/zigloo99/rails_projects/demo_app/Rakefile:7:in `<top (required)>'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/usr/local/rvm/gems/[email protected]/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/usr/local/rvm/gems/[email protected]/bin/rake:19:in `load'
/usr/local/rvm/gems/[email protected]/bin/rake:19:in `<main>'
我使用RVM太紅寶石1.9.2和3.0.7軌道中的教程。 有什麼想法?
[demo_app] $寶石查詢 ***當地的寶石*** 抽象(1.0.0) 的ActionMailer(3.0.7) ActionPack的(3.0.7 ) activemodel的(3.0.7) ActiveRecord的(3.0.7) 的ActiveResource(3.0.7) 的ActiveSupport(3.0.7) AREL(2.0.10) 助洗劑(2.1.2) 捆綁(1.0.13) 個erubis(2.6.6) I18N(0.5.0) 郵件(2.2.19) MIME類型(1.16) 通曉(0.3.1) 機架(1.2.2) 機架式(0.6.14 ) 架測試(0.5.7) 導軌(3.0.7) railties(3.0.7) 耙(0.9.0) sqlite3的-紅寶石(1.3.2) 托爾(0.14.6) 樹梢( 1.4.9) tzinfo(0.3.27) – zigloo99 2011-05-23 00:02:06
[Undefined method'task'using rake 0.9.0.beta.4]的可能重複(http://stackoverflow.com/questions/5287121/undefined-method-task-使用rake-0-9-0-beta-4) – sawa 2011-05-23 00:05:23