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 'https://cran.rstudio.com/src/contrib/rlang_0.4.8.tar.gz'
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
	‘/private/var/folders/x9/kf9z5_h5525bh3fdrf1dnsm00000gn/T/RtmptThXSw/downloaded_packages’

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.
https://cran.r-project.org/bin/macosx/tools/

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

install.packages("rlang")

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.