Linux上的特拉维斯CI

时间:2018-01-22 09:51:09

标签: travis-ci linuxbrew

我正在尝试在Travis CI上安装linuxbrew,但由于我不理解的原因它失败了。特拉维斯CI声称:

default ruby version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

但是当我的.travis.yml文件执行:

 sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

它失败了:

HEAD is now at 851177a29 docs: update gems. (#569)
/usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `strip!': can't modify frozen String (RuntimeError)
    from /usr/lib/ruby/1.9.1/rubygems/version.rb:191:in `initialize'
    from -e:1:in `new'
    from -e:1:in `<main>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:12:in `<main>': Homebrew must be run under Ruby 2.3! You're running 1.9.3. (RuntimeError)
Failed during: /home/linuxbrew/.linuxbrew/bin/brew update --force

我认为这曾经发挥作用(去年),但突然之间失败了。如何在“可靠”上安装适用于Travis CI的Linuxbrew?

修改

这是我的.travis.yml

language: cpp
sudo: required
dist: trusty

before_install:
  - sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

结束修改

感谢。

1 个答案:

答案 0 :(得分:1)

似乎Linux上的Trave CI上的Linux浏览器在确定安装了哪个版本的Ruby时遇到了问题。要修复使用替代安装方法:

print (df1)
   Goods_ID  MinPriceShop  MinPrice
0         1             A      10.0
3         2             B      22.0
6         3             C       4.5

git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew export HOMEBREW_FORCE_VENDOR_RUBY=1 部分