Error when I try to install package glue

Here is the Error that I am getting

install.packages("glue")

There is a binary version available but the source version is later:
binary source needs_compilation
glue 1.3.2 1.4.0 TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘glue’

trying URL 'https://cran.rstudio.com/src/contrib/glue_1.4.0.tar.gz'
Content type 'application/x-gzip' length 98619 bytes (96 KB)

downloaded 96 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/3.6/Resources/library/glue’
    Warning in install.packages :
    installation of package ‘glue’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/sm/n_29n6351fg1sq5lt8jcfj1h0000gn/T/Rtmp6ZKJao/downloaded_packages’

I tried installing the package from an archive file and it did not work.

System Information:

  • RStudio Edition: Desktop
  • RStudio Version: 1.2.5033
  • OS Version: darwin15.6.0
  • R Version: 3.6.3 (2020-02-29)

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] knitr_1.28

loaded via a namespace (and not attached):
[1] compiler_3.6.3 assertthat_0.2.1 R6_2.4.1 tools_3.6.3 Rcpp_1.0.4
[6] xfun_0.12 rlang_0.4.5

1 Like

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers. Not required for this type of question.

On macOS, packages sometimes fail to install, often with a non-zero exit status message. This is due to Apple's idiosyncratic compiler. The same packages will install on most Linux systems without trouble. Saint Simon Urbanek of the R Core Development Team takes on the brain damage required to recode the source to get around macOS's peculiar worldview for those in CRAN, but he can't bestow the same mercy on those still in development.

Some packages will successfully install through compilation from source, but many won't.

When installing if you are offered the option to install from source, it makes sense to try it once. But, if at first it doesn't succeed, in all likelihood it never will. It's usually only 7-10 days until a macOS binary is available

So if I have tried installing from the CRAN repository and an archive file and it did not work then I will not be able to install it at all?

When you

install.packages("glue")

you'll be told that a binary version is available, but the source version is later. Do you want to install from sources the package which needs compilation? (Yes/no/cancel. Here what happens (illustrated with the sf package, which has the same issue currently)

This is what happens if you just say no:

  There is a binary version available but the source version is later:
   binary source needs_compilation
sf  0.8-1  0.9-0              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) n
trying URL 'http://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.6/sf_0.8-1.tgz'
Content type 'application/x-gzip' length 64283240 bytes (61.3 MB)
==================================================
downloaded 61.3 MB

library(sf)
Linking to GEOS 3.7.2, GDAL 2.4.2, PROJ 5.2.0

2 Likes

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