Spring阻止Rails控制台运行

Roc*_*160 7 ruby ruby-on-rails rails-spring

我最近将Ruby升级到2.5.0.从那以后,我无法正确运行Rails控制台.它要么无限期挂起,要么在几秒钟后向我显示此错误:

before_session hook failed: NoMethodError: undefined method `reject!' for nil:NilClass

完整错误:

Running via Spring preloader in process 6102
Loading development environment (Rails 5.1.4)
before_session hook failed: NoMethodError: undefined method `reject!' for nil:NilClass
Traceback (most recent call last):
/Users/zoro/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork': undefined method `reject!' for nil:NilClass (NoMethodError)
Run Code Online (Sandbox Code Playgroud)

如果我DISABLE_SPRING,我可以按预期启动我的控制台.但是,(不确定这是否相关,如果不是 - 我可以单独解决)如果发生任何错误,控制台"崩溃"并将我踢回终端:

?rails console
Loading development environment (Rails 5.1.4)
[1] pry(main)> a
Traceback (most recent call last):
bin/rails: undefined method `[]' for nil:NilClass (NoMethodError)
?
Run Code Online (Sandbox Code Playgroud)

任何有关这方面的帮助将不胜感激.使用rbenv来管理Rubies,并且在其他版本的Ruby上没有此错误.

Roc*_*160 15

binding_of_caller与Spring一起出现了一些奇怪的问题.删除那个宝石让事情恢复正常.我知道我一问完就能找到答案.

目前还没有修复,但似乎确实存在一个未解决的问题:https: //github.com/charliesome/better_errors/issues/411

  • 谢谢。再次检查,发现它已经在`0.8.0`版本中修复了! (2认同)