Can not update gems on production server.
I've tried bundle install --deployment
and bundle install --without development test
But keep getting:
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
EDIT
I don't know if this is correct, but needed a quick fix. I ran bundle install --no-deployment
then bundle update
then ran bundle install --deployment
again
I have had this problem (Ubuntu 12.10 & 12.04, one of which behind a proxy server). My problem was that I had some
git://
protocols in the Gemfile. Changing this tohttp://
helped me get it all working.The instructions are probably a bit confusing. It's saying that you've modified your
Gemfile
on your development machine and just pushed those changes rather than runningbundle install
BEFORE committing the changes.By running
bundle install
you will update yourGemfile.lock
file. This should be pushed to your server as it's more important thanGemfile
. Consider theGemfile
the plans for theGemfile.lock
file.Always remember to:
bundle install
if you change yourGemfile
, even just to make sure. If it's too slow, pass--local
through which forces it to only use local gems to resolve its dependencies.Gemfile
andGemfile.lock
file to your repositoryGemfile
andGemfile.lock
to your production servers to ensure that they're running the exact same dependencies as your development environment.Running
bundle update
by itself can be construed as dangerous that will update all the dependencies of your application. It's mainly dangerous if you don't have solid version numbers specified in theGemfile
. I wrote about it here.This can be caused by an old version of the bundler gem on the server you're deploying to (in this case production). Logging into the server and running a
gem update bundler
resolved the issue for me. The server I was deploying to was running version 1.7.4 and the current version was 1.9.I had an issue with my production server still using an old version of a gem, even though the Gemfile.lock showed the correct, updated version. My production server was running on Unicorn - and shutting down / starting it back up again fixed the issue - instead of sending the HUP signal, which did jack all to fix the issue.
bundle install failed on my "development" machine because of the mysql-gem on osx...
I also needed a quick fix. So I cloned the repo to a new folder on the production machine, ran "bundle install" there and committed the Gemfile.lock to the repo.
FYI: You can also get this error if you use source blocks like this:
You'll see an exclamation point in the Gemfile.lock for this gem:
Just define the additional source normally, i.e.
(BTW cf. here about using multiple gem sources.)