Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find pandoc #440

Closed
Liripo opened this issue Oct 17, 2022 · 2 comments · Fixed by #441 or #443
Closed

find pandoc #440

Liripo opened this issue Oct 17, 2022 · 2 comments · Fixed by #441 or #443

Comments

@Liripo
Copy link
Contributor

Liripo commented Oct 17, 2022

Hello:
When I use rocker docker, I have encountered the following problem.

docker run -u $UID --rm -it rocker/tidyverse:4.2 R -e 'htmlwidgets:::find_pandoc()'

The error is as follows:

> htmlwidgets:::find_pandoc()
sh: 1: //opt/pandoc/pandoc: not found
Error in system(paste(shQuote(pandoc_path), "--version"), intern = TRUE) : 
  error in running command
Calls: <Anonymous> ... get_pandoc_version -> with_pandoc_safe_environment -> force -> system
Execution halted

It was caused by

htmlwidgets/R/pandoc.R

Lines 176 to 182 in 9827b5f

if (!is_windows())
sources <- c(sources, path.expand("~/opt/pandoc"))
# determine the versions of the sources
versions <- lapply(sources, function(src) {
if (file.exists(src))
get_pandoc_version(src)
. I would like to ask if it is possible to judge pandoc binary files directly, not just directories?

@jcheng5
Copy link
Collaborator

jcheng5 commented Oct 17, 2022

I don't really know this code... but rmarkdown::find_pandoc seems to work (though it does take a surprising few seconds on my machine), so we probably just need to copy that over. @Liripo if you're up for making a pull request, I'd be grateful.

@Liripo
Copy link
Contributor Author

Liripo commented Oct 17, 2022

Thanks for your reply, I will check the rmarkdown::find_pandoc and try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants