Install "rlang" Package Issue

I want to use the "readxl" package. But every time I try it says I dont have the "rlang" package installed. I have tried to install the package but i get this error each time:

installing the source package ‘rlang’

trying URL ''
Content type 'application/x-gzip' length 847517 bytes (827 KB)
downloaded 827 KB

* installing *source* package ‘rlang’ ...
** package ‘rlang’ 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 ‘rlang’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rlang’
Warning in install.packages :
  installation of package ‘rlang’ had non-zero exit status

The downloaded source packages are in

Thanks in advance!

From your post, it seems rlang is currently only available to install from source (or maybe you are omitting something), which means it requires compilation, for compiling packages on macOS you need to install Xcode in your system (not in R) and the recommended development tools for macOS systems.

Thank you for that clarification!

I am very new to this. I have downloaded Xcode and gfortran. But i'm not sure how to compile the packages using Xcode. How do i go about this?

Many thanks!

You just have to restart your R session and try to install again


Thank you !! It works!!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

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.