2016-11-30 176 views
0

編輯。Rstudio/pandoc問題 - 無法編輯爲HTML或PDF

我現在使用的是Rstudio版本1.0.136和pandoc 1.19.2.1,沒有任何變化。

這讓我瘋狂。有人真的有這方面的線索嗎?

-

我不能編織到了HTML或PDF,儘管它曾經工作得很好。這是我不斷收到錯誤:

pandoc: out of memory (requested 1048576 bytes) 
Error in strsplit(version_info, "\n")[[1]] : subscript out of bounds 
Calls: <Anonymous> ... pandoc_available -> find_pandoc -> lapply -> FUN -> get_pandoc_version 
In addition: Warning message: 
running command ''/usr/lib/rstudio/bin/pandoc/pandoc' --version' had status 1 
Execution halted 

我曾經有Rstudio 0.999.903,我卸載了,然後我安裝了1.0.44版本,通過Rstudio重新安裝knitr包,但我又收到此錯誤。

我使用debian軟件包安裝程序從git倉庫安裝了pandoc 1.18-1,同樣的問題再次出現。

我試着卸載R並重新安裝了一個更新的版本,但沒有成功。

命令行工作:

library(rmarkdown) 
rmarkdown::render("test.Rmd", "html_document") 

-

我使用Debian(LMDE2)。

感謝您的幫助

+0

看起來它是pandoc和R工作室 https://github.com/rstudio/rmarkdown/issues/383 可能要在那邊發佈一個錯誤的bug。 – mtelesha

回答

1

最後我明白了!

看來這個bug在2年前被Arch用戶here描述。

看來這個bug是在Debian系統(我使用LMDE Betsy)的Rstudio版本0.98+中引入的。

與Rstudio一起安裝的pandoc版本不起作用,當我手動安裝pandoc時,Rstudio會堅持使用自己的破損版本。但無論如何,解決方法是刪除從Rstudio發行可執行pandoc,而符號pandoc的另一個版本來代替:

apt-get install pandoc 

rm /usr/lib/rstudio/bin/pandoc/pandoc 
ln -s /usr/bin/pandoc /usr/lib/rstudio/bin/pandoc/pandoc 

rm /usr/lib/rstudio/bin/pandoc/pandoc-citeproc 
ln -s /usr/bin/pandoc-citeproc /usr/lib/rstudio/bin/pandoc/pandoc-citeproc 

我發現這個解決辦法here

存儲庫有pandoc版本1.12,但更新的版本也可以使用。我現在使用pandoc 1.19.2.1和Rstudio 1.0.136。