ruby-on-rails – 在TeamCity中构建时安装捆绑包

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 在TeamCity中构建时安装捆绑包前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试在TeamCity中运行构建.我正在尝试为单元测试构建的应用程序在 Ruby on Rails中编码.

在克隆构建失败后,我将VCS根配置为从我的存储库获取.这里是:

Bundler::GemNotFound: Could not find gem 'devise (= 2.1.0) ruby' in the gems available on this machine.

Stacktrace:
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:346:in `block in resolve_requirement'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:344:in `catch'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:344:in `resolve_requirement'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:295:in `block in resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:294:in `reverse_each'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:294:in `resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb:172:in `specs_for'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/definition.rb:161:in `requested_specs'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/environment.rb:23:in `requested_specs'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:11:in `setup'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler.rb:107:in `setup'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.1.4/lib/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/root/TeamCity/buildAgent/work/a85b8d8560bb396b/config/boot.rb:10:in `<top (required)>'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/root/TeamCity/buildAgent/work/a85b8d8560bb396b/config/application.rb:1:in `<top (required)>'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/root/TeamCity/buildAgent/work/a85b8d8560bb396b/Rakefile:5:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/root/TeamCity/buildAgent/plugins/rake-runner/rb/runner/rake_ext.rb:314:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/root/TeamCity/buildAgent/plugins/rake-runner/rb/runner/rake_ext.rb:314:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/root/TeamCity/buildAgent/plugins/rake-runner/rb/runner/rake_ext.rb:179:in `run'
/root/TeamCity/buildAgent/plugins/rake-runner/rb/runner/rakerunner.rb:40:in `<main>'

Source: /root/TeamCity/buildAgent/work/a85b8d8560bb396b/Rakefile:5:in `<top (required)>'

它似乎需要首先运行bundle install,但是如何&在配置中可以在TeamCity上执行此操作?

解决方法

在“配置步骤3”的构建配置设置下 – > “构建步骤”将第一步添加为“命令行”步骤,该步骤调用bundle install.

不要忘记通过添加“构建功能”并选择“Ruby环境配置器”来设置Ruby环境(如上面的“配置步骤3” – >“构建步骤”).然后,您可以选择您的rvm ruby​​版本和gemset.看看你的堆栈跟踪,这将是ruby-1.9.2-p320作为解释器名称,全局作为gemset.

原文链接:https://www.f2er.com/ruby/271409.html

猜你在找的Ruby相关文章