Reputation: 787
My application was running fine with Ruby 2.2.4, until running a test gave me an error saying "the ruby version you're using is outdated/buggy".
So I updated and used Ruby 2.3.0 as the default for my application. After that I got an error saying "could not find bundler".
I already had bundler, so why does updating the Ruby version require reinstalling bundler into my application?
(I am learning Ruby-on-Rails, so treat me as a beginner.)
Upvotes: 1
Views: 368
Reputation: 37657
Each copy of Ruby installed on a computer has its own set of installed gems. One reason that gems aren't shared between installations of Ruby is that some gems include compiled native code, and the compiled output might be different for different versions of Ruby.
bundler is a standalone gem, not part of Ruby, so whenever you install a new Ruby you have to install bundler in that Ruby.
This is independent of whether you're using a Ruby version manager (chruby, rbenv, rvm, etc.); if you install a new Ruby, it needs its own set of installed gems.
Upvotes: 4
Reputation: 354
I also had faced such issue. First I run this with selected RVM version.
gem install bundle
Then you should run:
bundle install
In your project directory.
Please let me know if you have any confusion.
Upvotes: 1
Reputation: 19839
Whenever you install a new version of Ruby with RVM it creates a wrapper with what they call gemsets
. Gemsets are not shared between ruby version so therefore when you installed your new Ruby 2.3.0
it installed without any gems.
To fix this problem simply install bundler
by running gem install bundler
.
Once that's done, you should have it available for your new installation of Ruby.
Upvotes: 1