Read more

During deployment: "You are trying to install in deployment mode after changing your Gemfile"

Thomas Eisenbarth
April 10, 2019Software engineer at makandra GmbH

While deploying an Ruby update to an old application these days, we encountered the following misleading error:

*** [err :: some-host.makandra.de] You are trying to install in deployment mode after changing
*** [err :: some-host.makandra.de] your Gemfile. Run `bundle install` elsewhere and add the
*** [err :: some-host.makandra.de] updated Gemfile.lock to version control.
*** [err :: some-host.makandra.de] 
*** [err :: some-host.makandra.de] You have deleted from the Gemfile:
*** [err :: some-host.makandra.de] *
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

We found out a newer version of bundler runs on the machines to be deployed to (see bundle -v, it was 2.0.1 in our case) while in the Gemfile.lock an old version of bundler is mentioned in the BUNDLED_WITH block:

BUNDLED WITH
   1.17.1

This broke during deployment while Capistrano tries to run bundle --deployment --quiet --without development test. On our development machines bundle install run successfully.

Fix this by making sure both sides use the same major versions of bundler (preferably 2.x).

Posted by Thomas Eisenbarth to makandra dev (2019-04-10 16:29)