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 book lover

Growing Rails Applications in Practice

Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.

  • Introduce design conventions for controllers and user-facing models
  • Create a system for growth
  • Build applications to last
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)