Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring/application.rb:161 undefined method `reject!' for nil:NilClass (NoMethodError)

I am using ruby 2.5 and rails 5.0.1 for my application. when i try to run console or generate controller or migration it gives me this error:

Running via Spring preloader in process 6473 Loading development environment (Rails 5.0.1) Traceback (most recent call last): /home/abwahed/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.1/lib/spring/application.rb:161:infork': undefined method reject!' for nil:NilClass (NoMethodError)

like image 875
Abdul Wahed Avatar asked Feb 01 '18 19:02

Abdul Wahed


1 Answers

There was an active discussion about this issue few days back here in spring gems repo. The underlying ruby gem binding_of_caller was creating the issue with ruby 2.5.0. The issue is marked as closed with a pr now here in binding_of_caller_repo. So, I think you can simply do a bundle update or bundle update binding_of_caller to fix it. You can also try downgrading ruby to 2.4.3 if that doesn't worked. Hope this helps.

like image 80
Muhammed Anees Avatar answered Sep 29 '22 15:09

Muhammed Anees