我在 Hudson CI 中有一个损坏的构建,我不确定如何修复。问题似乎很简单——加载了不正确的 gem 版本——但 Hudson 控制台输出似乎与错误消息相矛盾。
Hudson 的console
构建输出:
[...hudson fetching code from SCM...]
Commencing build of Revision 496c7a18b3b56b14037d2d643858cec217be289a (origin/master)
Checking out Revision 496c7a18b3b56b14037d2d643858cec217be289a (origin/master)
[workspace] $ bash -xe /tmp/hudson424603273172296439.sh
+ export RAILS_ENV=hudson
+ RAILS_ENV=hudson
+ bundle install
[...list of a bunch of gems, truncated...]
Using launchy (2.1.0)
[...the rest of the gems...]
[32mYour bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.[0m
+ bundle exec rake hudson:all --trace
/home/build/build_gems/gems/bundler-1.0.7/lib/bundler/runtime.rb:27:in `setup': You have already activated launchy 0.3.7, but your Gemfile requires launchy 2.1.0. Consider using bundle exec. (Gem::LoadError)
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/runtime.rb:17:in `setup'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler.rb:100:in `setup'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/cli.rb:343:in `exec'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /home/build/build_gems/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /home/build/build_gems/gems/bundler-1.0.7/bin/bundle:13
from /home/build/build_gems/bin/bundle:19:in `load'
from /home/build/build_gems/bin/bundle:19
Build step 'Execute shell' marked build as failure
因此,该bundle install
命令显示launchy (2.1.0)
正在使用,但错误表明launchy 0.3.7
已激活。我不确定哪里有这种差异/冲突。
如您所见,我们正在使用bundle exec
运行构建,因此应该应用捆绑包,所以我不确定这里发生了什么。
在 hudson 项目配置的“Build => Execute shell”部分,我有以下三行,这就是全部:
export RAILS_ENV="hudson"
bundle install
bundle exec rake hudson:all --trace
Gemfile
拥有:
...
group :development, :cucumber, :test,:hudson do
gem "populator", ">= 0.2.5"
gem "factory_girl",">= 1.2.1"
gem "faker", ">= 0.3.1"
gem "rspec", "1.3.2"
gem "rspec-rails", "1.3.4"
gem "webrat"
gem "capybara"
gem 'launchy'
gem "cucumber","1.1.8"
gem "cucumber-rails","0.3.2"
gem "database_cleaner"
gem "ruby-debug"
end
...
Gemfile.lock
有:
GEM
...
specs:
...
launchy (2.1.0)
...
...
DEPENDENCIES
...
launchy
...