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

bundle install --deployment
failed to install gems via bundler. heroku
gemfile.lock required. please check it in.
you have deleted from the gemfile
bundle config set deployment true
failed to install gems via bundler push rejected, failed to compile ruby app push failed
what does bundle install do
run bundle install to install missing gems

I'm pretty new to bundler and capistrano, and I'm trying to use them together. When I try to deploy, I get the message:

You are trying to install in deployment mode after changing your Gemfile. Run `bundle install' elsewhere and add the updated Gemfile.lock to version control.

I don't know how to satisfy the system that's complaining, and I don't understand why the complaint is coming up because I read in the doc:

If a Gemfile.lock does exist, and you have updated your Gemfile(5), bundler will use the dependencies in the Gemfile.lock for all gems that you did not update, but will re-resolve the dependencies of gems that you did update. You can find more information about this update process below under CONSERVATIVE UPDATING.

I interpret that to mean that the Bundler can handle the fact that my Gemfile is not whatever it expected. Any help?

Specs: Ruby 1.9.3, Rails 3.2.3, Capistrano 2.12.0, Bundler 1.1.4, Windows 7, deploying to a Posix machine.

Edit: My Gemfile includes logic blocks like the following:

unless RbConfig::CONFIG['host_os'] === 'mingw32'
  # gem 'a' ...
end

The error message you're getting regarding Gemfile.lock may be because your Gemfile and Gemfile.lock don't agree with each other. It sounds like you've changed something in your Gemfile since you last ran bundle install (or update). When you bundle install, it updates your Gemfile.lock with any changes you've made to Gemfile.

Make sure you run bundle install locally, and check-in to source control your newly updated Gemfile.lock after that. Then try deploying.

Edit: As recognised in the comments, a conditional in the Gemfile resulted in a valid Gemfile.lock on one platform, invalid on another. Providing a :platform flag for these platform-dependent gems in the Gemfile should solve the asymmetry.

Bundler: You are trying to install in deployment mode after changing , The error message you're getting regarding Gemfile.lock may be because your Gemfile and Gemfile.lock don't agree with each other. It sounds  You are trying to install in deployment mode after changing your Gemfile Bundler 1.14.5 version #5472


vi .bundle/config

change the BUNDLE_FROZEN option from '1' to '0'

do "bundle install"


OR

run "bundle config"

see if the "frozen" value is true set it to false

bundle config frozen false

During deployment: "You are trying to install in deployment mode , [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`  All source code included in the card During deployment: "You are trying to install in deployment mode after changing your Gemfile" is licensed under the license stated below. This includes both code snippets embedded in the card text and code that is included as a file attachment.


Watch out for global Bundler config.

I had a global config on my dev environment in ~/.bundle/config that I did not have in my CI / Production environment that caused the Gemfile.lock that was generated in my dev environment to be different than the one in my CI / Production environment.

In my case I was setting github.https to true in my dev environment but had no such config in my CI / Production environment. This caused the two Gemfile.lock files to be different.

Why am I seeing errors asking to update my Gemfile.lock?, remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run bundle install elsewhere and add the remote: updated  Erro Heroku: You are trying to install in deployment mode after changing your Gemfile. Run `bundle install` elsewhere and add the updated Gemfile.lock to version control.


When you see the following...

$ bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* source: rubygems repository https://rubygems.org/
* rails (~> 3.2)
. . .

... Then, the problem is most likely that you have outdated .gem files in your vendor/cache directory.

Perhaps, you previously ran $bundle install --deployment which put some "outdated" .gem files in the cache?

In any case, you can get past this error by running: bundle install --no-deployment

That's one of the many great things about Rails... the error messages often tell you exactly what to do to fix the problem.

Bundle --deployment & --no-deployment - Rails, You are trying to install in deployment mode after changing your the Gemfile and run 'bundle install' which installs the gem and vendors I ran into something similar before. One way to fix it, I think, but may take more space on your server than you want, is to run. bundle install --deployment and then try to deploy. This does something like install all of your gems into the vendor folder, which I believe is generally good to avoid but will still probably work.


My specific problem was related to what reported by @JoshPinter, i.e. dev-vs-deploy host discrepancies in the protocol used by bundler to retrieve gems from github.

To make a long story short, all I had to was modify the following Gemfile entry...

gem 'activeadmin', github: 'activeadmin'

...to this secure syntax (see reference):

gem 'activeadmin', git: 'https://github.com/activeadmin/activeadmin.git'

And my deployments are back to normal.

bundle install, If this is the first time you run bundle install (and a Gemfile.lock does not exist), In deployment mode, Bundler will 'roll-out' the bundle for production or CI use. In general, after making a change to the Gemfile(5) , you should first try to run  bundler_test % bundle install --deployment You are trying to install in deployment mode after changing your Gemfile. Run ` bundle install ` elsewhere and add the updated Gemfile.lock to version control.


ruby on rails Bundler: You are trying to install in deployment mode , When I try to deploy, I get the message: You are trying to install in deployment mode after changing your Gemfile. Run `bundle install'  The problem was that starting with Bundler 1.15.0, `Bundler.setup` fails with an `ArgumentError` raised from `Pathname#relative_path_from` when the following conditions are met: - Bundler is in deployment mode; and - A Gemfile is explicitly specified via the `BUNDLE_GEMFILE` environment variable; and - That Gemfile is not an absolute path (e.g


Unable to push recent changes to old ruby website on heroku , ruby on rails Bundler: You are trying to install in deployment mode after changing your Gemfile? @JoshuaPinter, yes this saved me! albeit with spending several  You are trying to install in deployment mode after changing your Gemfile. Run `bundle install` elsewhere and add the updated Gemfile.lock to version control. If this is a development machine, remove the Gemfile freeze by running `bundle install --no-deployment`.


remote: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote:  remove Gemfile.lock form your local project and form .gitignore (if it exist there) run bundle install; commit changes to git repo ( new created Gemfile.lock ) run git push heroku master