Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] failed installation (resolved) #33

Open
karenword opened this issue May 28, 2021 · 2 comments
Open

[macOS] failed installation (resolved) #33

karenword opened this issue May 28, 2021 · 2 comments
Labels
Alpha Testing This PR is associated with the Alpha Test of the new lesson template (codename: Buoyant Barnacle) macOS This issue contains elements specific to macOS SOLUTION This issue has a solution available in the comments

Comments

@karenword
Copy link

The downloaded binary packages are in
	/var/folders/wk/lgkwbq65675bthtnxv0gpqlw0000gn/T//Rtmp3exw72/downloaded_packages
> rmarkdown::pandoc_version()
[1] ‘2.11.4’
> tmp <- tempfile()
> sandpaper::create_lesson(tmp, open = FALSE)
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
Error: .onLoad failed in loadNamespace() for 'credentials', details:
  call: NULL
  error: Failed to call 'git help -a'
> sandpaper::build_lesson(tmp, preview = FALSE, quiet = TRUE)
Error in normalizePath(path, winslash = "/", mustWork = TRUE) : 
  path[1]="/var/folders/wk/lgkwbq65675bthtnxv0gpqlw0000gn/T//Rtmp3exw72/file170fc777f538b": No such file or directory
> fs::dir_tree(tmp, recurse = 1)
Error: [ENOENT] Failed to search directory '/var/folders/wk/lgkwbq65675bthtnxv0gpqlw0000gn/T/Rtmp3exw72/file170fc777f538b': no such file or directory
@zkamvar
Copy link
Contributor

zkamvar commented May 28, 2021

Note: user does have git installed and is able to use it from the command line and RStudio terminal.

system("git help -a") does NOT work and gives the above "invalid active developer" error in RStudio ONLY. It works in vanilla R.

@zkamvar
Copy link
Contributor

zkamvar commented May 29, 2021

Solution

The solution to this is to open the mac terminal and type

xcode-select --install

Analysis

This issue was triggered when {credentials} was loaded, which is imported by {gert}, which is used by {sandpaper} to bootstrap lessons.

Karen had installed the latest version of git to /usr/local/bin/git and had /usr/local/bin ahead of /usr/bin on her $PATH and was able to verify that she had installed git version 2.31.0 and it was workable from the mac terminal. When she tried system("git help -a") from her RStudio terminal, she got the following error:

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

Inspecting the $PATH variable in RStudio via Sys.getenv("PATH") revealed that /usr/bin/ was installed above /usr/local/bin/, so git would always default to the mac git, which would fail if XCode were not updated.

@zkamvar zkamvar added Alpha Testing This PR is associated with the Alpha Test of the new lesson template (codename: Buoyant Barnacle) macOS This issue contains elements specific to macOS SOLUTION This issue has a solution available in the comments labels Jun 1, 2021
@zkamvar zkamvar changed the title failed installation [macOS] failed installation (resolved) Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Alpha Testing This PR is associated with the Alpha Test of the new lesson template (codename: Buoyant Barnacle) macOS This issue contains elements specific to macOS SOLUTION This issue has a solution available in the comments
Projects
None yet
Development

No branches or pull requests

2 participants