Posted over 5 years ago. Visible to the public.

When upgrading/downgrading RubyGems and Bundler on a server, you must clear bundled gems

On application servers, gems are usually bundled into the project directory, at a location shared across deployments.

This is usually shared/bundle inside your project's root directory, e.g. /var/www/your-project/shared/bundle/.
If you can't find that, take a look at current/.bundle/config and look for BUNDLE_PATH.

When you are changing the version of RubyGems or Bundler on a system where gems are installed this way, you must wipe that bundle directory in addition to the user and system gems or gems that are already installed will not be reinstalled for the new RubyGems or Bundler.

Some gems may include binaries that are turned into binstubs by RubyGems and thus implicitly rely on a certain RubyGems version. Especially when downgrading Rubygems, you will encounter issues.

Note that removing the directory will prevent new application workers from booting up. You need to deploy soon after.

Also see: Fix Rubygems binary error: undefined method `activate_bin_path' for Gem:Module (NoMethodError)

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for unsupported versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2).

Owner of this card:

Dominik Schöler
Last edit:
4 months ago
by Michael Leimstädtner
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more