【发布时间】:2015-04-01 01:53:35
【问题描述】:
我对 ruby on rails 非常陌生,在为我的“计划”资源创建新控制器时遇到了这个问题:
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)
这个错误说明 spring 版本错误,但我真的不知道如何解决这个问题。
*编辑:已解决:This post solved my problem
【问题讨论】:
-
运行
bundle exec rails generate controller plans;这将解决问题。解释见stackoverflow.com/questions/6588674/…。 -
已经试过了:'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 设置块:您已经激活了 spring 1.3.3,但是您的 Gemfile 需要 spring 1.3.1。将 bundle exec 添加到您的命令可能会解决此问题。 (Gem::LoadError)'
-
首先,使用
bin/spring stop停止spring;然后移除弹簧bin/spring binstub --remove --all;最后,执行bundle install和bundle exec spring binstub --all。在此之后,运行你的生成器。
标签: ruby-on-rails ruby spring controller gemfile