reinstall every gem for each ruby version?

BrainLikeADullPencil picture BrainLikeADullPencil · Mar 10, 2013 · Viewed 10.9k times · Source

I just installed Ruby 2.0.0 using rbenv and set it to the global ruby version for my system. Since 2.0 is compatible with 1.9.3, I tried to start up a Rails project with it, but got the following error. I did rbenv rehash after installing 2.0

The `rails' command exists in these Ruby versions:
  1.9.3-p327

Does this mean that every gem I installed on my system with 1.9.3 has to be reinstalled if I wish to use it with 2.0?

Answer

Adam Barthelson picture Adam Barthelson · Mar 10, 2013

As seen here:

You need to reinstall bundler for each version of Ruby you use. See Ruby versions where you have it installed:

rbenv whence bundle

See your current version:

rbenv version

Install bundler for that version, if missing:

gem install bundler