r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.39k stars 760 forks source link

Can't install devtools on Rstudio on Mac #2479

Closed gabrielluishernandez closed 1 year ago

gabrielluishernandez commented 1 year ago

I am doing the following on Rstudio Mac: install.packages("devtools")

Then I get:

Screenshot 2022-10-15 at 20 56 46

When I typed "yes" it tries to install some things and then: installation of package ‘cli’ had non-zero exit status

installation of package ‘rlang’ had non-zero exit status

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘rlang’ 1.0.2 is being loaded, but >= 1.0.3 is required Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace Execution halted

installation of package ‘pkgload’ had non-zero exit status

installation of package ‘roxygen2’ had non-zero exit status

installation of package ‘testthat’ had non-zero exit status

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘cli’ 3.2.0 is already loaded, but >= 3.3.0 is required Calls: <Anonymous> ... namespaceImportFrom -> asNamespace -> loadNamespace Execution halted

installation of package ‘devtools’ had non-zero exit status

I have tried to install these packages individually but keep getting the same errors. I have asked on Google but failed to find a solution.

Thank you very much for your help,

gabrielluishernandez commented 1 year ago

I have solved it based on this: https://developer.apple.com/forums/thread/711512 I ran: xcode-select --install Then restarted my computer and installed devtools.

Thanks