Error when trying to use "usethis" -- concerning missing "xcrun" and Command Line Tools.

Hi,

I'm trying to use "usethis" to create a Xaringan presentation on my Mac, with version control and a Git Hub repo.

I'm following these instructions: Deploying xaringan Slides: A Ten-Step GitHub Pages Workflow | Silvia Canelón

Here are the two error messages I get when I start:

> usethis::create_project("/Users/howardm/XaringanCaseConferences/CaseConferenceApril6th2021")
✓ Setting active project to '/Users/howardm/XaringanCaseConferences/CaseConferenceApril6th2021'
✓ Creating 'R/'
✓ Writing 'CaseConferenceApril6th2021.Rproj'
✓ Adding '.Rproj.user' to '.gitignore'
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
✓ Opening '/Users/howardm/XaringanCaseConferences/CaseConferenceApril6th2021/' in new RStudio session
✓ Setting active project to '<no active project>'

and, continuing, later

> usethis::use_git()
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I haven't gone beyond this point.

Does anyone know what this is about ? I have previously installed the Command Line tools from the Apple developers page on my machine:

At the Terminal, I get:

xcode-select -p
/Library/Developer/CommandLineTools

Thanks,

Howard

I think you have to install Xcode in your system (not in R)

And you might also want to check the recommended development tools for macOS systems.
https://cran.r-project.org/bin/macosx/tools/

@andresrcs

Thanks for your interest.

Do I really need to install Xcode ?

I can successfully do the following: Establish Github repo first and then, locally: File > New Project > Version Control > Git

(Chapter 16 Existing project, GitHub first | Happy Git and GitHub for the useR)

Should I not then be able to do it in the reverse direction, too -- using "usethis" ?

Howard

The error message is asking for xcrun which comes with Xcode, now if your question is why usethis requires xcrun, then I think it would be better answered on the GitHub repository by the developers.

@andresrcs

O.K.

The following fixed everything for me:

xcode-select --install

Thanks!

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.