rmarkdown使用googleVis失败 - pandoc不支持https - 适用于RStudio

时间:2016-05-25 15:24:13

标签: rstudio r-markdown pandoc googlevis

我有一个使用googleVis库的Rmarkdown文档。 它在RStudio上工作正常。我只需按“编织HTML”按钮和“voilá”:我得到一个漂亮的HTML。

但是,当我尝试在命令行上生成时,我在Pandoc中收到错误。

我跑了:

Rscript --verbose -e 'script.R'

其中script.R是:

rmarkdown::render("inputFile.Rmd", output_dir=file.path("/path/to/my/dir"), output_file="outfile.html", encoding="UTF-8");

我得到的错误是:

 (.....)
 output file: 5c86eb19-d29f-4ac6-ac35-87e72fb42bbd2787560825121738853.knit.md 

 /opt/local/bin/pandoc +RTS -K512m -RTS 5c86eb19-d29f-4ac6-ac35-87e72fb42bbd2787560825121738853.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output /Users/rodrigo/Documents/Nitryx/Technical/Projects/NitroERP/repository/5c86eb19-d29f-4ac6-ac35-87e72fb42bbd.html --smart --email-obfuscation none --self-contained --standalone --section-divs --table-of-contents --toc-depth 2 --variable toc_float=1 --variable toc_selectors=h1,h2 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --template /opt/local/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/default.html --number-sections --variable 'theme:bootstrap' --include-in-header /var/folders/dd/y3fs2t5j1n3fg8nfq1syrzym0000gn/T//RtmpTjWUT6/rmarkdown-str301943f9d761.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --no-highlight --variable highlightjs=/opt/local/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/highlight --variable navigationjs=/opt/local/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/h/navigation-1.0  
 Fetching https://www.google.com/jsapi?callback=displayChartGaugeID30195c82acb7... 
 pandoc: Failed to retrieve https://www.google.com/jsapi?callback=displayChartGaugeID30195c82acb7 
 user error (https not supported) 
 Error: pandoc document conversion failed with error 61 
 Execution halted 

请注意:

pandoc: Failed to retrieve https://www.google.com/jsapi?callback=displayChartGaugeID30195c82acb7
user error (https not supported)

但它适用于RStudio ...

你能帮忙吗?

1 个答案:

答案 0 :(得分:1)

RStudio可能使用与您在命令行上获得的版本不同的pandoc版本...(请参阅例如this issue。)

尝试安装最新的pandoc并确保您使用pandoc -v