2015-02-10 8 views
25

मुझे एक सर्वर पर होस्ट किए गए मेरे ऐप चमक से पीडीएफ रिपोर्ट उत्पन्न करने में समस्या है।पैंडोक संस्करण 1.12.3 या उच्चतर आवश्यक है और नहीं मिला (आर चमकदार)

एप्लिकेशन ठीक काम करता है लेकिन जब मैं रिपोर्ट डाउनलोड करने के लिए बटन दबाते हैं, मैं इस त्रुटि मिलती है:

pandoc 1.12.3.3 
Compiled with texmath 0.6.6, highlighting-kate 0.5.6.1. 
Syntax highlighting is supported for the following languages: 
    actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog, 
    clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d, 
    diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang, 
    fortran, fsharp, gnuassembler, go, haskell, haxe, html, ini, java, javadoc, 
    javascript, json, jsp, julia, latex, lex, literatecurry, literatehaskell, 
    lua, makefile, mandoc, markdown, matlab, maxima, metafont, mips, modelines, 
    modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml, 
    octave, pascal, perl, php, pike, postscript, prolog, python, r, 
    relaxngcompact, restructuredtext, rhtml, roff, ruby, rust, scala, scheme, 
    sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo, verilog, vhdl, 
    xml, xorg, xslt, xul, yacc, yaml 
Default user data directory: /home/daniele/.pandoc 
Copyright (C) 2006-2013 John MacFarlane 
Web: http://johnmacfarlane.net/pandoc 
This is free software; see the source for copying conditions. There is no 
warranty, not even for merchantability or fitness for a particular purpose. 

तो:

pandoc version 1.12.3 or higher is required and was not found. 

समस्याओं है कि अगर मैं pandoc -v टाइप मैं मिलता है मुझे लगता है कि मेरे पास इसका सही संस्करण है। TexLive भी स्थापित है और पथ $PATH में है।

Server.R

library(shiny) 
library(drsmooth) 
library(shinyBS) 
library(knitr) 
library(xtable) 
library(rmarkdown) 

shinyServer(function(input, output,session) { 

output$downloadReport <- downloadHandler(
filename = function() { 
    paste('report', sep = '.','pdf') 
}, 

content = function(file) { 
    src <- normalizePath('report.Rmd') 

    # temporarily switch to the temp dir, in case you do not have write 
    # permission to the current working directory 
    owd <- setwd(tempdir()) 
    on.exit(setwd(owd)) 
    file.copy(src, 'report.Rmd') 

    library(rmarkdown) 
    out <- render('report.Rmd') 
    file.rename(out, file) 
}) 

output$tb <- renderUI({ 
      p(h4("Report")), 
      "Dowload a the report of your analysis in a pdf format", 
      tags$br(),downloadButton('downloadReport',label="Download report"), 
      tags$em("This option will be available soon") 
    }) 
}) 

* report.Rmd * गणना किसी भी प्रकार शामिल नहीं है, यह केवल पाठ। पीडीएफ पीढ़ी मेरे स्थानीय संस्करण (मैकोज़) पर ठीक काम करती है लेकिन सर्वर पर नहीं।

अग्रिम धन्यवाद, और यदि आवश्यक हो तो मैं अन्य जानकारी देने के लिए यहां हूं।

RStudio में डेनियल

उत्तर

46

जाओ और के लिए RSTUDIO_PANDOC

Sys.getenv("RSTUDIO_PANDOC") 

प्रणाली वातावरण चर को खोजने के फिर उस से पहले आदेश प्रस्तुत करना बुला करने के लिए अपने अनुसंधान लिपि में डाल दिया।

Sys.setenv(RSTUDIO_PANDOC="--- insert directory here ---") 

यह मेरे लिए काम करता है जब मैं यह पता लगाने के लिए संघर्ष कर रहा था कि रैंडडाउन कैसे पांडोक पाता है। मुझे स्रोत देखने के लिए जिथब जांचना पड़ा।

+2

यह मेरे लिए काम किया है, जबकि बैश में 'export' कमांड का उपयोग करके नहीं किया गया था (मैंने 'pandoc' निर्देशिका को' $ PATH' में जोड़ने और '$ RSTUDIO_PANDOC'' सेट करने का प्रयास किया था। – knowah

+0

क्या यह अभी भी काम करता है यदि आपके पास RStudio इंस्टॉल नहीं है? – user5359531

+3

फिर भी एक और विकल्प यह है कि इसे अपनी परियोजना 'RSTUDIO_PANDOC =/usr/lib/rstudio/bin/pandoc' में स्थानीय' रेन्यूशन 'फ़ाइल में जोड़ना है रेफरी: https://csgillespie.github.io/efficientR/3-3 -r-startup.html # renviron – Interfector

8

एक और विकल्प यह है कि यह आपकी सभी आर स्क्रिप्ट के लिए काम करता है यह वैश्विक स्तर पर इस चर को परिभाषित करना है।

Debian/Ubuntu पर, अपने .bashrc फ़ाइल में निम्न पंक्ति जोड़ें:

export RSTUDIO_PANDOC=/usr/lib/rstudio/bin/pandoc 

MacOS पर, अपने .bash_profile फाइल करने के लिए निम्नलिखित जोड़ें:

export RSTUDIO_PANDOC=/Applications/RStudio.app/Contents/MacOS/pandoc 
संबंधित मुद्दे