Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Travis上构建图书并返回GitHub页面_R_Travis Ci_Bookdown - Fatal编程技术网

在Travis上构建图书并返回GitHub页面

在Travis上构建图书并返回GitHub页面,r,travis-ci,bookdown,R,Travis Ci,Bookdown,我正在使用托管在GitHub上的bookdown编写一本书,一个令人沮丧的是,在我将更改推回到GitHub之前,我一直忘记构建这本书。因此,我提出的一个解决方案是使用Travis构建我的书并将其部署到gh页面分支。我正在使用htmlproofer检查我书中的链接,因此我需要我的Travis build使用ruby语言,而不是R。但是,我看不到如何访问Rscript命令,因为它没有安装在环境中。我当前的.travis.yml是 language: ruby rvm: - 2.3.3 befor

我正在使用托管在GitHub上的
bookdown
编写一本书,一个令人沮丧的是,在我将更改推回到GitHub之前,我一直忘记构建这本书。因此,我提出的一个解决方案是使用Travis构建我的书并将其部署到
gh页面
分支。我正在使用
htmlproofer
检查我书中的链接,因此我需要我的Travis build使用
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
我尝试使用
sudo apt get install r-base
,但这给了我
r
版本
2.14.1
,它太旧了


有什么想法吗?

为了解决这个问题,我切换到了
语言:R
构建,因为这也是Ruby自带的。答案是详细的

从PPA中添加R?所以
sudo添加apt存储库ppa:marutter/rdev
?然后
sudo apt get install r-base
?那应该会给我最新版本吧?可能需要
sudo添加apt存储库ppa:marutter/rdev
然后
sudo-apt-get-update-yy
,最后
sudo-apt-get-install r-base