So you're getting an error like this:
undefined method `activate_bin_path' for Gem:Module (NoMethodError)
Here is what happened:
bundle
, rake
or rails
) with code that only works with modern Rubygems versionsGem.activate_pin_path(...)
that was written out by the new Rubygems version.In general, try to upgrade/downgrade Rubygems to the version you want before installing any gems. This way you won't run into the issue above.
Simply run
gem pristine --all
gem update --system="x.y.z"
.gem install bundler
.bundle install
or gem install
.Also see: When upgrading/downgrading RubyGems and Bundler on a server, you must clear bundled gems