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
The instructions are probably a bit confusing. It’s saying that you’ve modified your
Gemfileon your development machine and just pushed those changes rather than runningbundle installBEFORE committing the changes.By running
bundle installyou will update yourGemfile.lockfile. This should be pushed to your server as it’s more important thanGemfile. Consider theGemfilethe plans for theGemfile.lockfile.Always remember to:
bundle installif you change yourGemfile, even just to make sure. If it’s too slow, pass--localthrough which forces it to only use local gems to resolve its dependencies.GemfileandGemfile.lockfile to your repositoryGemfileandGemfile.lockto your production servers to ensure that they’re running the exact same dependencies as your development environment.Running
bundle updateby 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.