为什么bundle exec spring
无效?
我已经调用bundle exec
并返回错误。我可以随时打电话给bundle exec
。 (这是可能的重复问题的解决方案)。
我不会通过bundle update spring
更新我的Gemfile或卸载spring
版本以使其正常工作。我不应该被迫改变我的宝石安装。
bundle binstubs spring
也没有。
steve-air:finalcloud main$ spring -v
Spring version 1.3.5
steve-air:finalcloud main$ bundle exec spring -v
Spring version 1.3.4
steve-air:finalcloud main$ bundle exec spring
/Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:34:in `block in setup': You have already activated spring 1.3.5, but your Gemfile requires spring 1.3.4. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.7/lib/bundler/runtime.rb:19:in `setup'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.7/lib/bundler.rb:122:in `setup'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.9.7/lib/bundler/setup.rb:8:in `<top (required)>'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.5/lib/spring/commands.rb:33:in `<module:Spring>'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.5/lib/spring/commands.rb:4:in `<top (required)>'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.5/lib/spring/server.rb:9:in `<top (required)>'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /Users/main/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
要复制:
rebenv
安装Ruby。答案 0 :(得分:7)
经过一番探索之后,似乎可以在这里发挥一些作用:
该问题的根本原因似乎是https://github.com/rails/spring/issues/295,已在1.3.6中修复。请参阅:https://github.com/rails/spring/blob/master/CHANGELOG.md#136
可悲的是,事实证明你无法使用作者在问题中指定的约束来解决这个问题。
答案 1 :(得分:3)
这是Spring中的一个错误fixed in version 1.3.6。
我不会更新我的Gemfile(通过捆绑更新弹簧)或卸载弹簧版本以使其工作 - 我不应该被迫更改我的宝石安装。
不幸的是,这些是1.3.6之前版本中唯一已知的解决方法。
答案 2 :(得分:1)
只需卸载旧版本的spring gem
即可for k=1:max(size(y))
r=b*y(k,:)';
p(k)=r'*M;
end