2

I am very new to ruby on rails and I'm having this problem with creating a new controller for my "plans" resource:

rails generate controller plans
/Users/RentaroSatomi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.0/lib/bundler/runtime.rb:34:in 
'block in setup': You have already activated spring 1.3.3, 
but your Gemfile requires spring 1.3.1. 
Prepending 'bundle exec' to your command may solve this. (Gem::LoadError)

The error says something about having a wrong spring version, but I really don't know how to fix this.

*EDIT: Solved: This post solved my problem

Community
  • 1
  • 1
TheRailsRouter
  • 115
  • 1
  • 6
  • Run `bundle exec rails generate controller plans`; that will fix the issue. See http://stackoverflow.com/questions/6588674/what-does-bundle-exec-rake-mean for the explanation. – Prakash Murthy Apr 01 '15 at 01:59
  • Already tried that: 'bundle exec rails generate controller plans /Users/RentaroSatomi/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/bundler-1.8.0/lib/bundler/runtime.rb:34:in block in setup: You have already activated spring 1.3.3, but your Gemfile requires spring 1.3.1. Prepending bundle exec to your command may solve this. (Gem::LoadError)' – TheRailsRouter Apr 01 '15 at 02:05
  • First, stop spring using `bin/spring stop` ; then remove spring `bin/spring binstub --remove --all` ; Finally, do `bundle install` and `bundle exec spring binstub --all`. After this, run your generators. – bsvin33t Apr 01 '15 at 02:19

1 Answers1

1

Try updating your Spring gem only. In your console:

bundle update spring
Tiago Farias
  • 3,397
  • 1
  • 27
  • 30