Sunday, November 18, 2012

ERROR: Gem bundler is not installed, run `gem install bundler` first... FIXED

Have you ever had the problem when using RVM that bundler is listed as an installed gem, yet trying to run bundler gives you an error? This is obviously a regularly recurring problem as there are many posts about this issue... and most of them don't work.

jseidel@EDP15:~/Dev/WebForms$ gem list

 *** LOCAL GEMS ***

bundler (1.1.5)
json (1.7.5)
rake (0.9.2.2)
ruby-ole (1.2.11.4)
rubygems-bundler (1.0.6)
rvm (1.11.3.5)
spreadsheet (0.7.3)
jseidel@EDP15:~/Dev/WebForms$ bundle install
ERROR: Gem bundler is not installed, run `gem install bundler` first.
jseidel@EDP15:~/Dev/WebForms$ whence bundle
bundle is /home/jseidel/.rvm/bin/bundle
My .bashrc script has the proper RVM incantations at the end of the file, and I've got a gemset defined... everything looks perfect, except that it doesn't work.  I've gotten bitten by this more than once, so at least with this post I won't have to go searching all over the place again to find the solution.

If you tried everything else and it still doesn't fix the problem, run the command:
rvm reload
and you should be good to go. Hopefully this'll help someone avoid the fruitless searches I went through. It would be nice if there was some kind of helpful message from RVM or somewhere a clear explanation of why this happens occasionally for no apparent reason.