2

The latest branch of my project includes changes to the Gemfile based on the upgrade to Bundler 1.10.5, notably the use of a source block for two internal gems. This appears to be the cause of a problem when attempting to deploy to the testing server, where capistrano throws an error and rolls back the deploy.

Command generating errors:

bundle install --gemfile /path/to/Gemfile --path /path/to/shared/bundle --deployment --without development test

Error message (private data anonymized but otherwise as in the original):

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.

You have deleted from the Gemfile:
* internal_gem1 (= 0.1.11)
* internal_gem2 (= 0.0.6)

You have changed in the Gemfile:
* internal_gem1 from `no specified source` to `rubygems repository

http://rubygems.org/, https://REDACTED@gem.fury.io/me/`
* internal_gem2 from `no specified source` to `rubygems repository
http://rubygems.org/, https://REDACTED@gem.fury.io/me/`

Gemfile contains lines:

source 'http://rubygems.org'
source 'https://REDACTED@gem.fury.io/me/' do
  gem 'internal_gem1', '0.1.11' #, :path => '/path/to/gem/optional'
  gem 'internal_gem2', '0.0.6'
end

gem "bundler", "~> 1.7"
... 
# more gems and some groups follow
...

BUNDLED WITH
   1.10.5

Based on common sense and a comment to this answer, I tried running gem install bundler -v '1.10.5' on the testing server, and it appears to have installed (installation messages showed success and gem which bundler returns a path containing the new version number), but there was no change in the deployment error.

Both Gemfile and Gemfile.lock are tracked in git and get deployed to the server (as per this answer). There is no vendor/cache directory present (as per this answer). Everything works smoothly locally, and deployment of a branch without the source block in the Gemfile went smoothly just a few hours ago. How can I fix this Bundler deployment problem?

Community
  • 1
  • 1
joanwolk
  • 1,105
  • 1
  • 15
  • 26
  • It is possible that you have updated `bundler` on your CI server but not your app server. I also ran into the same issue and tried the same fix. When I ssh-ed into the app box, I discovered the version of `bundler` was ancient, which was what our capistrano job was using during deployment. – myconode Sep 21 '15 at 23:00

0 Answers0