1

我正在写一本bookdown托管在 GitHub 上的书,一个令人沮丧的是,在我将更改推回 GitHub 之前,我一直忘记构建这本书。所以我想出的一个解决方案是使用 Travis 构建我的书并将其部署到gh-pages分支。我htmlproofer用来检查我书中的链接,所以我需要我的 Travis 构建来使用该ruby语言而不是R. 但是,我看不到如何访问该Rscript命令,因为它没有安装在环境中。我现在.travis.yml

language: ruby
rvm:
  - 2.3.3
before_script:
  - chmod +x ./scripts/cibuild.sh
script:
  - ./scripts/cibuild.sh
deploy:
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
  local_dir: docs
  on:
    branch: master
env:
  global:
    - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
notifications:
  email: false
sudo: false

哪里cibuild只是一个bash包含的脚本

#!/bin/sh

Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::gitbook')"
htmlproofer ./docs

我尝试使用 asudo apt-get install r-base但这给了我太旧的R版本......2.14.1

有任何想法吗?

4

1 回答 1

1

为了解决这个问题,我切换到一个language: R构建,因为它也带有 Ruby。答案在这里很详细

于 2017-05-18T10:54:02.837 回答