Unable to Create New Markdown Files or Knit Existing Ones

Hello all,

I updated R to 4.0.2 yesterday, and that seems to have crippled RMarkdown for me. I am able to create new R scripts, but I cannot create new Markdown files or knit my existing ones. Whenever I try to knit a file that previously knit fine, I am confronted by the following message: "Install Required Packages: Rendering R Markdown documents requires updated versions of the following packages: rmarkdown, xfun. Do you want to install these packages now?" Whenever I try to create a new file, I am confronted by an almost-identical message. The only difference is a single word: "Rendering R Markdown..." becomes "Creating R Markdown..." When I click yes to both prompts, the output in Jobs is identical.

I am unfortunately unable to include the output from "Jobs" that was generated by clicking "Yes" to the prompt above in the body of my question - as a new user, I am limited to two links per question, and there are a number of links in the Jobs output. The output I receive is identical regardless of whether I am trying to knit or to create a new file.

Clicking "Yes" when prompted invariably does not work. The file will not knit, or the new Markdown file will not be created. When I try to knit again, or click to try and create a new Markdown file again, I am presented with the same prompts from before: "Install Required Packages: Rendering/Creating R Markdown documents requires updated versions of the following packages: rmarkdown, xfun. Do you want to install these packages now?" I wind up right back where I started all over again.

Within my existing R Markdown documents, trying to run any library() line often results in a fatal error as well. The errors I receive from this follow the following format:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘xfun’

I'm not sure if that has any bearing on the issues I have with knitting and creating new documents, but I figured I would include it, just in case.

I am using Mac OS Sierra (10.12.6) - I don't know whether that might have any bearing on this. I have deleted and reinstalled R and RStudio twice today in the hopes that something would shift this, all to no avail. I have tried manually installing rmarkdown and xfun, to no avail. I have been completely stuck for the past four hours and have no idea where to go from here. Any insight anyone has on what I need to do would be greatly appreciated.

Thank you!

1 Like

A quick update, with what I've been able to accomplish the past hour: by using the Tools tab in the toolbar, I was able to manually install xfun. For the moment (and hopefully permanently), this has stopped the fatal errors I got when running library() lines in R Markdown.

I still am unable to properly install the rmarkdown package. Attempting to knit or create a new Markdown file yields "Install Required Packages: Rendering/Creating R Markdown documents requires an updated version of the rmarkdown package. Do you want to install this package now?" Clicking "Yes" yields a similar Jobs output to the original one, and yields the same result - nothing changes, and when I try to knit or create a new file again, I'm confronted with the same prompt. If anyone has any insight, I would greatly appreciate it. The Job output is as follows:

Installing 'rmarkdown' for R Markdown...
Installing package into ‘/Users/brianbrew/Library/R/4.0/library’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rmarkdown 2.3 2.4 FALSE
installing the source package ‘rmarkdown’

trying URL 'https://cran.rstudio.com/src/contrib/rmarkdown_2.4.tar.gz'
Content type 'application/x-gzip' length 3202546 bytes (3.1 MB)

downloaded 3.1 MB

dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib

/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 3512 Done echo 'tools:::.install_packages()'
3513 Abort trap: 6 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" myArgs --no-echo --args {args}

The downloaded source packages are in
‘/private/var/folders/nt/lv_407p149s6_tj6_pkjh1fw0000gn/T/Rtmp66qFA4/downloaded_packages’

:heavy_check_mark: Package 'rmarkdown' successfully installed.
Warning message:
In utils::install.packages("rmarkdown", repos = "https://cran.rstudio.com/") :
installation of package ‘rmarkdown’ had non-zero exit status

Issue has been resolved with the following code:

install.packages(“rmarkdown”, type =“mac.binary”)

I am now able to knit and create new Markdown documents as intended.

To make sure everything's in the same answer and people don't have to go digging, using the Tools tab and installing xfun directly solved that part of the problem.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.