gpt4 book ai didi

ruby - 使用 Node 5 构建 travis-ci ruby

转载 作者:数据小太阳 更新时间:2023-10-29 06:58:24 26 4
gpt4 key购买 nike

我尝试了很多东西,但最终未能获得 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

虽然这似乎更新了 Node ,但它对我的 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.

问题话虽如此,我如何通过这个 .travis.yml 简单地使用 Node 5?

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

最佳答案

尝试为 adding a second language 使用 before_install 阶段在 Travis 上,可能是这样的:

before_install:
- nvm install node

nvm 应默认安装在 Travis 构建镜像上(取决于您使用的是哪个),此命令将安装最新版本的 Node。

在那之后,也许只需将 npm install -g gulp-cli@4.0 作为 before_script 阶段的第一步(即不要担心更新 npm) ,希望这应该意味着 bundler 仍能正常运行并安装您所有的 gem。

关于ruby - 使用 Node 5 构建 travis-ci ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36224163/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com