vinhnx / notes

my today I learn (TIL) journal, includes everything that I found interesting, not necessarily relates to programming
43 stars 2 forks source link

rbenv: bundle: command not found #205

Open vinhnx opened 5 years ago

vinhnx commented 5 years ago

Having /usr/bin/bundle means that Bundler is installed in your system Ruby (/usr/bin/ruby). That's not necessarily a problem, but you don't want to use that Bundler; you want to use the Bundler installed in your local Ruby version managed by rbenv.

Because ~/.rbenv/shims/bundle doesn't exist, I would guess that your local version of Ruby either doesn't have Bundler installed, or you haven't run rbenv rehash after installing Bundler. Check these things:

  • gem env - verify that you're using RubyGems inside your location version of Ruby for this project, not the system version
  • gem list bundler - it should be installed. If not, install it.
  • rbenv rehash - This should be run after every gem install. You can install the rbenv-gem-rehash plugin to avoid having to do this step all the time.

ref https://github.com/rbenv/rbenv/issues/576#issuecomment-39901621

roller8 commented 5 years ago

This might also be related: https://bundler.io/blog/2019/01/04/an-update-on-the-bundler-2-release.html

can't find gem bundler (>= 0.a) with executable bundle is caused when you have bundler 2 installed but Rubygems is out of date (rubygems 3 needed for bundle 2.0 and rubygems 2.5 needed for 2.0.1)