2

I'm honestly so lost. Every time I try to run any rails commands ie, rails g controller home, the command line throws me this error and I have no idea what's going on. I've uninstalled and reinstalled spring and I've also googled.

Someone help please?

Johnny@Johnnys-MacBook-Pro original_skillup (feature/s3_uploader) $ rails g controller spring
/Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `block in preload': undefined method `[]' for nil:NilClass (NoMethodError)
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `map'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:102:in `rescue in preload'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:115:in `preload'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
  from /Users/Johnny/.rvm/gems/ruby-2.2.1/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
  from /Users/Johnny/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /Users/Johnny/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from -e:1:in `<main>'

Thanks!

Johnny Ji
  • 169
  • 2
  • 11

3 Answers3

2

I think you have Spring gem installed and the name of controller is conflicting.

https://github.com/rails/spring

Try changing the name of controller. Hopefully it works. Cheers!

aadarshsg
  • 2,069
  • 16
  • 25
0

To the previous answer, you can have a controller named home (there's no naming issues with that). It does look like you have an issue with the version of the spring gem you are using. Have you tried running 'bundle install'? I checked the spring gem on Github and it does not look like there are any current issues with the gem. You could remove the spring gem and see if the issue persists, if so, then you know the issue lies deeper.

  • I've done bundle install.. But the wierd thing is that this error only happens on this on project... my other apps are fine :S – Johnny Ji Jun 11 '15 at 05:12
0

That is Exception backrace issue in spring gem.

https://github.com/rails/spring/pull/459

update spring to 1.6.1

Jaehyun Shin
  • 1,562
  • 14
  • 25