travis-ci ruby​​使用节点5构建

我尝试过很多东西,但最终没能让 gulp-pipeline-rails的版本运行.该脚本在本地运行,没问题.

我缩小的最后一个问题是我有一个使用node的ruby语言项目,但是I need node 5.我找到了one snippet

#------------------------------
# Update the node version
env:
  - TraviS_NODE_VERSION="5"

install:
  - pwd
  - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TraviS_NODE_VERSION
  - npm install

虽然这似乎让节点更新,但它对我的ruby env做了一些事情,它在fails to execute rspec

$pwd && bundle exec rake
/home/travis/build/alienfast/gulp-pipeline-rails
Could not find gem 'rspec' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.


尽管如此,我如何简单地使用节点5与此.travis.yml?

language: ruby
rvm:
  - 2.2.2
  - ruby-head

matrix:
  allow_failures:
    - rvm: ruby-head

cache: bundler

#------------------------------
# Setup
before_script:
  - node -v
  # update npm
  - npm install npm -g

  # install Gulp 4 CLI tools globally from 4.0 GitHub branch
  - npm install https://github.com/gulpjs/gulp-cli/tarball/4.0 -g

#------------------------------
# Build
script: bundle exec rake

解决方法

尝试在Travis上使用适用于 adding a second language的before_install阶段,可能类似于:
before_install:
  - nvm install node

认情况下,应该在Travis构建映像上安装nvm(取决于您正在使用的映像),此命令将安装最新版本的Node.

在那之后,也许只需要npm install -g gulp-cli@4.0作为你的before_script阶段的第一步(即不要担心更新npm),希望这应该意味着捆绑包仍然运行正常并安装你所有的宝石.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...