Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
665 views
in Technique[技术] by (71.8m points)

ruby - Bundler and wrong binstubs?

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.

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?

When I run the bundle binstub rails I get this output

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

which ruby

/Users/evan/.rvm/rubies/ruby-2.0.0-p247/bin/ruby

which bundler

/Users/evan/.rvm/gems/ruby-2.0.0-p247/bin/bundler

Rails 4.0.2

Edit:

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

What worked for me was

rm -rf bin/*

Then open a new terminal session and

bundle exec rake app:update:bin


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...