TRAVIS CI:`find_spec_for_exe':找不到带有可执行包的 gem 打包器(>= 0.a)(Gem::GemNotFoundException) [英] TRAVIS CI: `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
问题描述
我找到的有关此问题的所有答案都与操作系统本身有关.这个问题发生在 Travis CI 中.这是我的代码:
All the answers that I've found about this problem are related to the OS itself. This problem is occurring in Travis CI. This is my code:
# .travis.yml
language: ruby
cache: bundler
rvm:
- 2.5.3
services:
- postgresql
before_script:
- psql -c 'create database makerspacerepo;' -U postgres
- openssl req -x509 -newkey rsa:4096 -keyout certs/saml.key -out certs/saml.crt -days 1 -nodes -subj "/C=CA/ST=Ontario/L=Ottawa/O=uOttawa/OU=Richard L'Abbé Makerspace/CN=makerepo.com/emailAddress=travis-ci@makerepo.com"
jobs:
include:
- stage: test
name: Test
script:
- bundle exec rake db:migrate RAILS_ENV=test
- bundle exec rake test RAILS_ENV=test
- stage: deploy
name: Deploy
script:
- openssl aes-256-cbc -k $DEPLOY_KEY -d -a -in config/deploy_id_rsa_enc_travis -out config/deploy_id_rsa
- chmod 600 config/deploy_id_rsa
- eval "$(ssh-agent -s)"
- ssh-add config/deploy_id_rsa
- bundle exec cap staging deploy
stages:
- name: test
- name: deploy
if: branch = staging
我能够成功构建,突然它开始给我这个错误:
I was able to build successfully and suddenly it started to give me this error:
$ bundle install --jobs=3 --retry=3 --deployment
/home/travis/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
from /home/travis/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
from /home/travis/.rvm/gems/ruby-2.5.3@global/bin/bundle:23:in `<main>'
from /home/travis/.rvm/gems/ruby-2.5.3@global/bin/ruby_executable_hooks:24:in `eval'
from /home/travis/.rvm/gems/ruby-2.5.3@global/bin/ruby_executable_hooks:24:in `<main>'
The command "eval bundle install --jobs=3 --retry=3 --deployment " failed. Retrying, 2 of 3.
我试图指定一个 dist(dist:trusty
和 dist:xenial
).我也尝试评论 cache: bundler
.到目前为止没有成功.
I have tried to specify a dist (dist: trusty
and dist: xenial
). I've tried to also comment cache: bundler
. No success so far.
推荐答案
我将以下内容添加到 .travis.yml 以使 Travis CI 工作.
I added the following to .travis.yml to get Travis CI to work.
dist: trusty
他们的默认 Ubuntu 版本现在是 Xenial.我认为它有一个由于某种原因不兼容的 ruby gems 版本???
Their default version of Ubuntu is now Xenial. I think that it has a version of ruby gems that isn't compatible for some reason???
以下问题可能与您的相同吗?
The following question could be the same as yours?
Travis-CI 在我尝试构建我的网站时给我一个错误.如果 bundler 与 gemfile.lock 文件匹配,会出现什么问题?
这篇关于TRAVIS CI:`find_spec_for_exe':找不到带有可执行包的 gem 打包器(>= 0.a)(Gem::GemNotFoundException)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!