私のプロジェクトの最新ブランチには、Bundler 1.10.5 へのアップグレードに基づく Gemfile への変更が含まれています。特に、2 つの内部 gem のソース ブロックを使用しています。これは、capistrano がエラーをスローしてデプロイをロールバックするテスト サーバーにデプロイしようとしたときに問題の原因のようです。
コマンド生成エラー:
bundle install --gemfile /path/to/Gemfile --path /path/to/shared/bundle --deployment --without development test
エラー メッセージ (プライベート データは匿名化されていますが、それ以外は元のメッセージと同じです):
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
次の行が含まれます:
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
常識とこの回答へのコメントに基づいて、テストサーバーで実行gem install bundler -v '1.10.5'
してみましたが、インストールされているように見えます (インストールメッセージは成功を示しgem which bundler
、新しいバージョン番号を含むパスを返します) が、展開エラーに変化はありませんでした.
Gemfile
との両方Gemfile.lock
が git で追跡され、サーバーにデプロイされます (この回答に従って)。ディレクトリは存在しません(この回答vendor/cache
に従って)。すべてがローカルでスムーズに動作し、Gemfile にソース ブロックがないブランチのデプロイは、ほんの数時間前にスムーズに完了しました。この Bundler 展開の問題を解決するにはどうすればよいですか?