Error in downloading glue package for RMarkdown


I am getting this error when trying to open a RMarkdown file on RStudio. Once I click yes, it says that the binary version of the glue package can't be found, so it uses the source version instead. I have tried looking up my problem - even downloading the binary version of the glue package - but I am still unsure of how to fix this problem.

This is what the console outputs:
Installing 'glue' for R Markdown...
There is a binary version available but the source version is later:
binary source needs_compilation
glue 1.6.0 1.6.1 TRUE
installing the source package ‘glue’

trying URL ''
Content type 'application/x-gzip' length 110723 bytes (108 KB)

downloaded 108 KB

  • installing source package ‘glue’ ...
    ** package ‘glue’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    ERROR: compilation failed for package ‘glue’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/glue’

The downloaded source packages are in

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

I would appreciate any advice/help you can give me.


This means that your macOS isn't equipped to compile from source. You need to download XCode from the App Store—it's quite large and takes a long time even over a fast connection. The you also need to install the command line tools from the terminal.

$ sudo xcode-select --install

This topic was automatically closed 21 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.