【发布时间】:2020-11-18 23:31:30
【问题描述】:
我正在处理一个在 2014 年左右制作的现有项目。运行 bundle exec rake db:migrate 时出现以下错误:
bundle exec rake db:migrate
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/object/duplicable.rb:82: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activesupport-4.0.0/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
rake aborted!
SystemStackError: stack level too deep
rake aborted!
NoMethodError: undefined method `reject' for nil:NilClass
Traceback (most recent call last):
D:/Ruby/Ruby26-x64/bin/rake: stack level too deep (SystemStackError)
D:/Ruby/Ruby26-x64/bin/rake: undefined method `reject' for nil:NilClass (NoMethodError)
9: from D:/Ruby/Ruby26-x64/bin/rake:23:in `<main>'
8: from D:/Ruby/Ruby26-x64/bin/rake:23:in `load'
7: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
6: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
5: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:185:in `standard_exception_handling'
4: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:195:in `rescue in standard_exception_handling'
3: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:208:in `display_error_message'
2: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:218:in `display_exception_details'
1: from D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:249:in `display_exception_backtrace'
D:/Ruby/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rake-13.0.1/lib/rake/backtrace.rb:21:in `collapse': undefined method `reject' for nil:NilClass (NoMethodError)
我的 Ruby 版本是 2.6.6p146,Rails 4.0.0(根据 gemfile 的要求)
我也读过类似的问题并尝试过gem update --system,但同样的问题仍然存在。
【问题讨论】:
标签: ruby-on-rails ruby rake