我正在为我的应用程序使用 ruby 2.5 和 rails 5.0.1。当我尝试运行控制台或生成 Controller 或迁移时,它给了我这个错误:
在进程 6473 中通过 Spring 预加载器运行
加载开发环境(Rails 5.0.1)
回溯(最近一次通话最后):
/home/abwahed/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.1/lib/spring/application.rb:161:in
fork':未定义的方法 reject!'对于 nil:NilClass (NoMethodError)
最佳答案
几天前有关于这个问题的积极讨论here在 Spring gem repo 中。底层 ruby gem binding_of_caller
在 ruby 2.5.0 中产生了问题。该问题现在在 binding_of_caller_repo 中用 pr 标记为已关闭.所以,我认为你可以简单地做一个 bundle update
或 bundle update binding_of_caller
来修复它。如果不起作用,您也可以尝试将 ruby 降级到 2.4.3
。希望这会有所帮助。
关于ruby-on-rails - spring/application.rb :161 undefined method `reject!' for nil:NilClass (NoMethodError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48570119/