2011-11-04 79 views
4

花费了一些时间而无需在rails上编程,现在我“回来了”出现了问题。 我安装了Ruby 1.9.2-p0和粘连,轨3.0.1.Updated所有宝石和捆绑运行successfully.Created一个新的Rails应用程序,并创建了一个迁移,但是运行rake db:migrate failed with error:“rake aborted!undefined method deprecate'for#<Rake :: Application:0x1e0c6c0>”

rake db:migrate 

,当我得到:

rake aborted! 
undefined method `deprecate' for #<Rake::Application:0x1e0c6c0> 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb:4:in `<top (required)>' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks/documentation.rake:1:in `require' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks/documentation.rake:1:in `<top (required)>' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks.rb:15:in `load' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks.rb:15:in `block in <top (required)>' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks.rb:6:in `each' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/tasks.rb:6:in `<top (required)>' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:213:in `require' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:213:in `initialize_tasks' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:139:in `load_tasks' 
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:77:in `method_missing' 
D:/sites/hebrew_learning/Rakefile:7:in `<top (required)>' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `load' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile' 
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1991:in `run' 
C:/Ruby192/bin/rake:31:in `<main>' 

我确实失去了这里,因此任何提示,将不胜感激

编辑:

运行

bundle exec rake 

我得到:

WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. 
at C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb 
WARNING: Global access to Rake DSL methods is deprecated. Please include 
... Rake::DSL into classes and modules which use the Rake DSL methods. 
WARNING: DSL method HebrewLearning::Application#task called at C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.1/lib/rails/application.rb:214:in `initialize_tasks' 
You have 1 pending migrations: 
20111104081644 CreateUsers 
Run "rake db:migrate" to update your database then try again. 
+0

你可以把你的迁移的代码? – eveevans

+0

你的意思是XXXXXXXXXX_migration_name.rb文件? – Daniel

+2

使用'bundle exec rake' – jdeseno

回答

1

如果使用的是轨道3.0.1,你可以在你的Gemfile试试这个:

gem 'rake' , '0.8.7' 

或尝试迁移到3.0.9改变你的gemfile。

该运行后:

bundle update 

再见

+0

我第二个..我遇到了这个早期的轨道3版本。切换耙到版本'0.8.7'应该解决这个问题。 – ashoda

相关问题