Read more

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

Dominik Schöler
February 01, 2017Software engineer at makandra GmbH

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

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

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)

Posted by Dominik Schöler to makandra dev (2017-02-01 17:10)