安装好的宝石看错路径(Travis build)

时间:2017-10-21 00:33:10

标签: ruby rubygems rvm travis-ci

我对OSX Travis构建持续存在问题。目前的问题是它无法运行由于此错误而安装的宝石,这显然它在错误的位置,因为它应该是2.1.10:

Could not find 'sass' (>= 0.a) among 298 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/travis/.rvm/gems/ruby-2.0.0-p648:/Users/travis/.rvm/gems/ruby-2.0.0-p648@global', execute `gem env` for more information
    from /Users/travis/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:324:in `to_spec'
    from /Users/travis/.rvm/rubies/ruby-2.0.0-p648/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
    from /Users/travis/.rvm/gems/ruby-2.1.10/bin/sass-convert:25:in `<main>'
    from /Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `eval'
    from /Users/travis/.rvm/gems/ruby-2.0.0-p648/bin/ruby_executable_hooks:15:in `<main>'

我已经输出了我能想到的所有内容来帮助调试,但不知道该寻找什么。有什么想法吗?编辑:对不起,以为链接会直接转到这些行,看起来他们不是。仍然相当容易找到,他们从2623行开始分组。

路径:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2623

gem env:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2624-L2665

GEM_PATH:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2666-L2667

rvm info:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2668-L2715

哪个红宝石:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2716-L2717

哪个宝石:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2718-L2719

宝石清单:https://travis-ci.org/szeck87/atom-beautify/jobs/290674283#L2720-L2874

1 个答案:

答案 0 :(得分:0)

问题是由Travis环境变量TRAVIS_COMMIT_MESSAGE引起的。当您在GitHub上合并PR时,默认提交消息有一个&#34;消息&#34;和一个&#34;描述&#34;,以换行符分隔。在TRAVIS_COMMIT_MESSAGE引起路径问题导致Ruby和/或Rubygems的路径问题。

通过在开始时在before_install步骤中将以下内容添加到我们的.travis.yml来消除环境变量来解决这个问题:

- export TRAVIS_COMMIT_MESSAGE=""