【问题标题】:rmarkdown fails using googleVis - pandoc does not support https - works on RStudiormarkdown 使用 googleVis 失败 - pandoc 不支持 https - 适用于 RStudio
【发布时间】:2016-05-25 15:24:13
【问题描述】:

我有一个使用 googleVis 库的 Rmarkdown 文档。 它在 RStudio 上运行良好。我只需按下“Knit 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...

你能帮忙吗?

【问题讨论】:

标签: rstudio r-markdown pandoc googlevis


【解决方案1】:

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

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

【讨论】:

  • 好电话。明天早上我会检查的!
  • 你是对的。我的 Mac 中有 4 个不同版本的 Pandoc: 1 个由 macports 安装; 1 由brew安装; 1 我通过 .dmg 安装; 1 安装在 RStudio 中。这是一团糟。我删除了旧版本并保留了 .dmg 一个(最新的)并且它有效。谢了!
猜你喜欢
  • 2016-05-22
  • 1970-01-01
  • 2012-01-20
  • 2020-03-18
  • 2016-06-26
  • 2017-03-02
  • 2013-05-26
  • 2018-02-23
  • 2014-11-04
相关资源
最近更新 更多