"-6ren"> "-花了一些时间没有在 Rails 上编程,现在我“回来了”,事情出了问题。 我安装了 ruby​​ 1.9.2-p0 并坚持使用 rails 3.0.1.Updated 所有 gems 和 bundle-6ren">
gpt4 book ai didi

ruby-on-rails - rake db:migrate 失败,错误为 :"rake aborted! undefined method ` deprecate' for #"

转载 作者:行者123 更新时间:2023-12-04 05:59:08 28 4
gpt4 key购买 nike

花了一些时间没有在 Rails 上编程,现在我“回来了”,事情出了问题。
我安装了 ruby​​ 1.9.2-p0 并坚持使用 rails 3.0.1.Updated 所有 gems 和 bundle 成功运行。创建了一个新的 rails 应用程序并创建了一个迁移,但是在运行时

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.

最佳答案

如果你使用的是 rails 3.0.1,你可以在你的 gemfile 中试试这个:

gem 'rake' , '0.8.7'

或尝试迁移到 3.0.9 更改您的 gemfile。

在那之后运行:
bundle update

再见

关于ruby-on-rails - rake db:migrate 失败,错误为 :"rake aborted! undefined method ` deprecate' for #<Rake::Application:0x1e0c6c0>",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8012581/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com