捆绑器和错误的垃圾桶? [英] Bundler and wrong binstubs?
问题描述
我运行 rails s
或 bundle exec rails
时,我得到以下警告:
I run rails s
or bundle exec rails s
and I get this warning:
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
这是什么意思?通过查看捆绑程序站点,我对binstubs的理解是您可以为它们设置可执行文件,因此无需运行 bundle exec blabla
,您只需执行 bin / blabla
。所以这个错误是说我的 bundler
没有设置到正确的垃圾桶?
What does this mean? From looking around the bundler site, my understanding of binstubs is that you can set executables to them, so instead of running bundle exec blabla
you can just do bin/blabla
. So this error is saying my bundler
isn't set to the right binstub?
当我运行 bundle binstub rails
我得到此输出
rails has no executables, but you may want one from a gem it depends on.
railties has: rails
bundler has: bundle, bundler
我不了解我的系统正在试图告诉我的内容,它并没有破坏任何内容,但是我有一种直觉,如果我不解决它,这可能会变成一个更大的问题
I do not understand what my system is trying to tell me, and it's not breaking anything, but I have a hunch this could turn into a bigger issue if I don't fix it
ruby 2.0.0p247
哪个红宝石
/Users/evan/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
捆绑器
/Users/evan/.rvm/gems/ruby-2.0.0-p247/bin/bundler
Rails 4.0.2
Rails 4.0.2
编辑:
因此,如果我在nag消息中运行命令:
So, if I run the commands in the nag message:
bundle config --delete bin # Turn off Bundler's stub generator
rake rails:update:bin # Use the new Rails 4 executables
我最终得到未初始化的常数Bundler
错误,而 bundle exec
命令和onl我发现可以通过以下方法修复该问题,即重新运行 bundle install --binstubs
,它会在这篇文章的开头带回nag消息。
I end up getting uninitialized constant Bundler
errors with bundle exec
commands and the only way I've found to fix that is to rerun bundle install --binstubs
which brings back the nag message at the start of this post.
推荐答案
对我有用的是
rm -rf bin / *
然后打开一个新的终端会话,
Then open a new terminal session and
捆绑执行rake app:update:bin
这篇关于捆绑器和错误的垃圾桶?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!