現象
TravisCIでRuby 1.9.3のテストを行うとインストールで失敗します。
TravisCIのJob logに以下のメッセージが表示されます。
$ rvm use 1.9.3 --install --binary --fuzzy
curl: (22) The requested URL returned error: 404 Not Found
Required ruby-1.9.3 is not installed - installing.
curl: (22) The requested URL returned error: 404 Not Found
Searching for binary rubies, this might take some time.
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
Gemset '' does not exist, 'rvm ruby-1.9.3 do rvm gemset create ' first, or append '--create'.
The command "rvm use 1.9.3 --install --binary --fuzzy" failed and exited with 2 during .
Your build has been stopped.
このときのビルド環境は以下の通りです。
job logのBuild system informationを展開すると表示されます。
Build system information
Build language: ruby
Build group: stable
Build dist: xenial
Build id: 554948482
Job id: 554948483
Runtime kernel version: 4.15.0-1028-gcp
travis-build version: 7b7f39e22
Build image provisioning date and time
Mon Mar 25 16:43:24 UTC 2019
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
原因
19年4月以降、TravisCIのビルド環境のデフォルトがUbuntu 16.04となりました。
参考:Ubuntu Xenial 16.04 as the default Travis CI build environment
ところが、Ubuntu16.04にはRuby 1.9.3がありません。
参考:Travis CI: Precompiled Ruby Versions
そのため、上記のようにインストールに失敗しました。
対処策
.travis.ymlでUbuntu 14.04を使用するように明示します。
dist: trusty # work at Ubuntu 14.04 for install Ruby 1.9.3
明示するとUbuntu14.04の環境でビルドが実行されます。
Build system information
Build language: ruby
Build group: stable
Build dist: trusty
Build id: 554950523
Job id: 554950524
Runtime kernel version: 4.4.0-101-generic
travis-build version: 7b7f39e22
Build image provisioning date and time
Tue Dec 5 19:58:13 UTC 2017
Operating System Details
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
ruby 1.9.3のインストールが成功します。
$ rvm use 1.9.3 --install --binary --fuzzy
curl: (22) The requested URL returned error: 404 Not Found
Required ruby-1.9.3-p551 is not installed - installing.
curl: (22) The requested URL returned error: 404 Not Found
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/ubuntu/14.04/x86_64/ruby-1.9.3-p551.tar.bz2
Checking requirements for ubuntu.
Requirements installation successful.
(snip)
Using /home/travis/.rvm/gems/ruby-1.9.3-p551
その他
Ubuntu 14.04とRuby1.9.3のサポートは終了しているのでテスト対象から外す方法もありますが
事情により今回はRuby 1.9.3でビルドする環境を整えてみました。