Skip to content

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Jan 23, 2014

Hi,

I got a undefined method call on .nil at line 106 of spring/application.rb.
After deeper investigation I've found out that my Gemfile didn't have sinatra, but other gem required it.
That caused spring to fail loading of rails app and crash.

This simple change checks that Rails.application is there before accessing it.

With this change it raises proper message that required file is not there.

Hi,

I got a undefined method call on .nil at line 106 of spring/application.rb.
After deeper investigation I've found out that my Gemfile didn't have sinatra, but other gem required it.
That caused spring to fail loading of rails app and crash.

This simple change checks that Rails.application is there before accessing it.

With this change it raises proper message that required file is not there.
@jshafton
Copy link

jshafton commented Feb 5, 2014

Same issue here, and your fix works for me. I'd probably switch and to && based on this logic though.

@mikz
Copy link
Contributor Author

mikz commented Feb 5, 2014

@jshafton changed

jonleighton added a commit that referenced this pull request Feb 8, 2014
Fix undefined method .path on nil
@jonleighton jonleighton merged commit 64744d3 into rails:master Feb 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants