以下是有问题的公共回购:https://travis-ci.org/agerwick/raw-sinatra-boilerplate
我按照此处的建议整合了codeclimate的测试记者宝石:http://docs.travis-ci.com/user/code-climate/
我一直遇到的错误是:/home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file -- codeclimate-test-reporter (LoadError)
从下面的日志中可以看出,Travis CI正在安装codeclimate-test-reporter gem。 我尝试使用CODECLIMATE_REPO_TOKEN环境变量集从我的本地计算机运行测试,并且它在这里工作得很好,更新了代码气候测试覆盖状态。因此,问题只出在travis上。
关于如何让Travis CI正确地要求codeclimate-test-reporter的任何建议?
出于历史目的,这里是Travis CI的日志:
Using worker: worker-linux-9-1.bb.travis-ci.org:travis-linux-16
system_info
Build system information
Build language: ruby
git.checkout
0.06s$ git clone --depth=50 --branch=master git://github.com/agerwick/raw-sinatra-boilerplate.git agerwick/raw-sinatra-boilerplate
Cloning into 'agerwick/raw-sinatra-boilerplate'...
remote: Counting objects: 223, done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 223 (delta 27), reused 0 (delta 0)
Receiving objects: 100% (223/223), 45.36 KiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), done.
Checking connectivity... done.
$ cd agerwick/raw-sinatra-boilerplate
$ git checkout -qf d659d86167d5c60f52e4013190ee5fd45dbb4b00
rvm
0.47s$ rvm use 2.0.0 --install --binary --fuzzy
Using /home/travis/.rvm/gems/ruby-2.0.0-p594
$ export BUNDLE_GEMFILE=$PWD/Gemfile
$ ruby --version
ruby 2.0.0p594 (2014-10-27 revision 48167) [x86_64-linux]
$ rvm --version
rvm 1.26.0 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.4
$ gem --version
2.4.2
before_install.1
0.01s$ export DISPLAY=:99.0
before_install.2
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
install.bundler
143.23s$ bundle install --jobs=3 --retry=3 --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching git://github.com/agerwick/rack-minitest.git
Installing mini_portile 0.6.1
Installing mime-types 2.4.3
Installing rack 1.5.2
Installing minitest 5.4.3
Installing docile 1.1.5
Installing json 1.8.1
Installing multi_json 1.10.1
Installing tilt 1.4.1
Using bundler 1.7.4
Installing simplecov-html 0.8.0
Installing rack-test 0.6.2
Installing rack-protection 1.5.3
Installing shotgun 0.9
Installing travis-lint 2.0.0
Installing haml 4.0.5
Installing simplecov 0.9.1
Using rack-minitest 0.0.9 from git://github.com/agerwick/rack-minitest.git (at master)
Installing sinatra 1.4.5
Installing codeclimate-test-reporter 0.4.1
Installing nokogiri 1.6.4.1
Installing xpath 2.0.0
Installing capybara 2.4.4
Installing capybara_minitest_spec 1.0.5
Installing capybara-webkit 1.3.1
Your bundle is complete!
It was installed into ./vendor/bundle
Post-install message from haml:
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:Installing docile 1.1.5
Installing json 1.8.1
Installing multi_json 1.10.1
Installing tilt 1.4.1
Using bundler 1.7.4
Installing simplecov-html 0.8.0
Installing rack-test 0.6.2
Installing rack-protection 1.5.3
Installing shotgun 0.9
Installing travis-lint 2.0.0
Installing haml 4.0.5
Installing simplecov 0.9.1
Using rack-minitest 0.0.9 from git://github.com/agerwick/rack-minitest.git (at master)
Installing sinatra 1.4.5
Installing codeclimate-test-reporter 0.4.1
Installing nokogiri 1.6.4.1
Installing xpath 2.0.0
Installing capybara 2.4.4
Installing capybara_minitest_spec 1.0.5
Installing capybara-webkit 1.3.1
Your bundle is complete!
It was installed into ./vendor/bundle
Post-install message from haml:
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:
* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem
For more info see:
http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
0.30s$ rake all
/home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- codeclimate-test-reporter (LoadError)
from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/spec_helper.rb:5:in `<top (required)>'
from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic_test_helper.rb:2:in `require_relative'
from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic_test_helper.rb:2:in `<top (required)>'
from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic/test_lib_core.rb:1:in `require_relative'
from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic/test_lib_core.rb:1:in `<top (required)>'
from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:15:in `block in <main>'
from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib" "/home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb" "test/business_logic/test_lib_core.rb" "test/database_calls/test_availability.rb" "test/acceptance/test_hello.rb" "test/acceptance/test_welcome.rb" "test/requests/test_index.rb" ]
/home/travis/.rvm/gems/ruby-2.0.0-p594/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.0.0-p594/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => all
(See full trace by running task with --trace)
The command "rake all" exited with 1.
Done. Your build exited with 1.
答案 0 :(得分:5)
看起来codeclimate-test-reporter
gem无法在运行时加载,这似乎是捆绑问题。
您应该尝试将rake all
更改为bundle exec rake all