pandoc version 1.12.3 or higher is required and was not found (R shiny)

后端 未结 10 2686
轮回少年
轮回少年 2020-11-29 02:09

I have a problem generating a pdf report from my app shiny which is hosted on a server.

the app works fine but when I press the button to download the report, I get

10条回答
  •  萌比男神i
    2020-11-29 03:05

    I had a similar problem with pandoc on Debian 10 while building a bookdown document. In the Makefile what I did was:

    # use rstudio pandoc
    # this rule sets the PANDOC environment variable from the shell
    build_book1:
        export RSTUDIO_PANDOC="/usr/lib/rstudio/bin/pandoc";\
        Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::gitbook")'
    
    # use rstudio pandoc
    # this rule sets the environment variable from R using multilines
    build_book2:
        Rscript -e "\
        Sys.setenv(RSTUDIO_PANDOC='/usr/lib/rstudio/bin/pandoc');\
        bookdown::render_book('index.Rmd', 'bookdown::gitbook')"
    

    These two rules are equivalent and knit the book successfully.

    I just didn't like the long Rscript command:

    Rscript -e "Sys.setenv(RSTUDIO_PANDOC='/usr/lib/rstudio/bin/pandoc'); bookdown::render_book('index.Rmd', 'bookdown::gitbook')"
    

提交回复
热议问题