0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TravisCIでRubyビルドが失敗する場合の対処法

Posted at

概要

Rubyビルド中に以下のようなエラーが出た場合の対処法になります。
(以下はTravisCIで発生したエラーをそのままコピペしたもの)

$ bundle install --jobs=3 --retry=3 --deployment
Traceback (most recent call last):
	4: from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `<main>'
	3: from /home/travis/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:15:in `eval'
	2: from /home/travis/.rvm/gems/ruby-2.5.1/bin/bundle:23:in `<main>'
	1: from /home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/home/travis/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

なぜエラーが起きたか

エラー内容をもとに調べて見たところ、下記を見つけました。
https://travis-ci.community/t/bundle-install-started-failing-on-ruby-build/4368

どうやら、TravisCIのベースがTrustyからXenialに変わったことが原因のようです。
https://kledgeb.blogspot.com/2013/08/ubuntu.html

対処法

.travis.ymlに下記を追加することで、今まで通りTrustyをベースにできるようなので、
今回はそれで対応したところビルドが成功するようになりました。

dist: trusty
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?