最近、github リポジトリ用に Travis-CI と Coveralls を統合した後、Travis を適切にビルドできません。次のエラーが表示されます。
$ ruby --version
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
$ rvm --version
rvm 1.26.8 (latest-minor) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.6
$ gem --version
2.4.5
install.bundler
5.06s$ bundle install --jobs=3 --retry=3 --deployment
Fetching gem metadata from http://rubygems.org/..........
Installing multi_json 1.10.1
Installing docile 1.1.5
Installing simplecov-html 0.8.0
Installing tins 1.3.3
Installing thor 0.19.1
Using bundler 1.7.6
Installing rake 10.4.2
Installing simplecov 0.9.1
Installing term-ansicolor 1.3.0
Installing coveralls 0.7.8
Your bundle is complete!
It was installed into ./vendor/bundle
0.80s$ bundle exec rake
/home/travis/.rvm/rubies/ruby-2.1.5/bin/ruby test/unit_test.rb
/home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls/api.rb:5:in `require': cannot load such file -- rest_client (LoadError)
from /home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls/api.rb:5:in `<class:API>'
from /home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls/api.rb:2:in `<module:Coveralls>'
from /home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls/api.rb:1:in `<top (required)>'
from /home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls.rb:3:in `require'
from /home/travis/build/devonparsons/ruby-tricks/vendor/bundle/ruby/2.1.0/gems/coveralls-0.7.8/lib/coveralls.rb:3:in `<top (required)>'
from test/unit_test.rb:3:in `require'
from test/unit_test.rb:3:in `<main>'
rake aborted!
明らかに、残りのクライアントをインストールしていませんが、Gemfile.lock (およびそれを修正しようとした後、Gemfile) の両方がそれを指定しています。
source 'http://rubygems.org'
gem 'coveralls', require: false
gem 'rest-client'
gem 'rake'
Gemfile.lock:
GEM
remote: http://rubygems.org/
specs:
coveralls (0.7.8)
multi_json (~> 1.10)
rest-client (~> 1.7)
simplecov (~> 0.9.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
docile (1.1.5)
ffi (1.9.6-x64-mingw32)
mime-types (2.4.3)
multi_json (1.10.1)
netrc (0.10.2)
rake (10.4.2)
rest-client (1.7.2-x64-mingw32)
ffi (~> 1.9)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
simplecov (0.9.1)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
tins (1.3.3)
PLATFORMS
x64-mingw32
DEPENDENCIES
coveralls
rake
rest-client
Travis の環境と私の環境の唯一の顕著な違いは、私の gem のバージョンが 2.2.2 で、バンドラーのバージョンが 1.7.12 であることです。
私が理解していないのは、Travis がテストを自動化するはずのときに --deployment フラグを渡す理由です - テスト環境にあってはいけませんか? いずれにせよ、bundle install --deployment
自分のマシンでは、Travis とは異なり、rest-client 1.7.2 がまだインストールされています。
rest-client が確実にインストールされるようにするにはどうすればよいですか?