我项目的最新分支包括基于升级到 Bundler 1.10.5 对 Gemfile 的更改,特别是对两个内部 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
返回包含新版本号的路径),但部署错误没有变化.
两者都在 gitGemfile
中Gemfile.lock
进行跟踪并部署到服务器(根据此答案)。不存在vendor/cache
目录(根据此答案)。一切都在本地顺利进行,并且在几个小时前,在 Gemfile 中没有源代码块的分支的部署也很顺利。如何解决此 Bundler 部署问题?