加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – “bundle exec spring”不能与rbenv一起使用?

发布时间:2020-12-16 22:11:55 所属栏目:百科 来源:网络整理
导读:为什么不绑定exec spring工作? 我已经调用bundle exec,并返回一个错误.我可以随时调用bundle exec. (这是可能的重复问题的解决方案). 我不会通过捆绑更新弹簧更新我的Gemfile或卸载一个版本的spring来使这项工作.我不应该被迫改变我的宝石安装. bundle bins
为什么不绑定exec spring工作?

我已经调用bundle exec,并返回一个错误.我可以随时调用bundle exec. (这是可能的重复问题的解决方案).

我不会通过捆绑更新弹簧更新我的Gemfile或卸载一个版本的spring来使这项工作.我不应该被迫改变我的宝石安装.

bundle binstubs弹簧也不工作.

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'

要复制:

有Ruby安装rebenv.
>卸载所有的Spring宝石.
>安装一个较低版本的Spring(如1.3.4).
>制作一个新的Rails应用程序
>安装更高版本的Spring(1.3.5似乎已经消失了,但是我用1.3.6复制了).
>按照我上面的命令行中的步骤.

解决方法

经过一番探索,似乎有几件事情在这里玩耍:

>系统安装宝石通过bundler安装宝石和特殊行为rails
>在rvm和bundle级别生成binstub
>在Spring 1.3.5中有奇怪的行为

这个问题的根本原因似乎是https://github.com/rails/spring/issues/295,固定在1.3.6.见:https://github.com/rails/spring/blob/master/CHANGELOG.md#136

可悲的是,事实证明,您无法解决这个问题,作者在问题中指定的限制.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读