2

I wonder if anyone can help me solve an issue I'm having with install_github. Whether I use remotes::install_github or devtools::install_github, I get the following error message that reads "System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr":

devtools::install_github("DenaJGibbon/gibbonR-package")
Downloading GitHub repo DenaJGibbon/gibbonR-package@HEAD
   The system cannot find the path specified.
√  checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d83d647a58\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ...
-  preparing 'gibbonR':
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'gibbonR_0.0.0.9000.tar.gz'
   
Error: Failed to install 'gibbonR' from GitHub:
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d83d647a58\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ... OK
E> * preparing 'gibbonR':
E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'gibbonR_0.0.0.9000.tar.gz'
E>

I thought this had to do with my path specifications and devtools/rtools, so in the end I did a fresh install of rtools and the whole setup procedure. Here's my system and path specs, and what I did:

  • Windows 10 64-bit and R Studio Version 1.4.1103
> version
_
platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
system         x86_64, mingw32
status
major          4
minor          0.2
year           2020
month          06
day            22
svn rev        78730
language       R
version.string R version 4.0.2 (2020-06-22)
nickname       Taking Off Again
  1. Downloaded Rtools (rtools40-x86_64.exe) from https://cran.r-project.org/bin/windows/Rtools/

  2. Added Rtools to my path, which now looks like:

> writeLines(strsplit(Sys.getenv("PATH"), ";")[[1]])
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64
C:\rtools40\usr\bin
C:\rtools40\mingw64\bin
  1. For good measure, created an .Renviron file in C:\Users\Ava\Documents, that includes the line PATH=${RTOOLS40_HOME}\usr\bin;${PATH} Exactly as shown - but I wasn't sure if I should have pasted the path to Rtools in the first variable...)

  2. Checking that Rtools is recognized:

> Sys.which("make")
make 
"C:\\rtools40\\usr\\bin\\make.exe"

> pkgbuild::check_rtools(TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

 > pkgbuild::has_rtools(TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

> pkgbuild::has_build_tools(debug=TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

> devtools::find_rtools(debug=TRUE)
Found in Rtools 4.0 installation folder
[1] TRUE

# After manually adding  C:\rtools40\mingw64\bin to a new env variable BINPREF: 
> Sys.getenv("BINPREF")
[1] "C:\\rtools40\\mingw64\\bin"

Yet, calls to devtools still fails with the same error message. I also don't understand this since Rcmd.exe is indeed on the path, at C:\Program Files\R\R-4.0.2\bin\x64

> devtools::install_github("DenaJGibbon/gibbonR-package", build_vignettes = FALSE)
Downloading GitHub repo DenaJGibbon/gibbonR-package@HEAD
The system cannot find the path specified.
√  checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpYHUJJi\remotes5f8032964d86\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ...
-  preparing 'gibbonR':
  √  checking DESCRIPTION meta-information ...
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'gibbonR_0.0.0.9000.tar.gz'

Error: Failed to install 'gibbonR' from GitHub:
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
  E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpYHUJJi\remotes5f8032964d86\DenaJGibbon-gibbonR-package-47acbc3/DESCRIPTION' ... OK
E> * preparing 'gibbonR':
  E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'gibbonR_0.0.0.9000.tar.gz'
E>

Now, it turns out the package I'm trying to download might not be available for R 4.0.2 (which I only found out by trying:

> pkgbuild::with_build_tools(install.packages("DenaJGibbon/gibbonR-package", type = "source"))
Installing package into ‘C:/Users/Ava/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘DenaJGibbon/gibbonR-package’ is not available (for R version 4.0.2)

But the error persists, since other packages that are available for 4.0 throw the same error:

devtools::install_github('hadley/ggplot2')
Downloading GitHub repo hadley/ggplot2@HEAD
The system cannot find the path specified.
√  checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d86e2e12ee\tidyverse-ggplot2-dbd7d79/DESCRIPTION' ...
-  preparing 'ggplot2': (1.7s)
√  checking DESCRIPTION meta-information ...
-  checking for LF line-endings in source and make files and shell scripts (952ms)
-  checking for empty or unneeded directories
-  building 'ggplot2_3.3.3.9000.tar.gz'

Error: Failed to install 'ggplot2' from GitHub:
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
  E> The system cannot find the path specified.
E> * checking for file 'C:\Users\Ava\AppData\Local\Temp\RtmpQbOqhX\remotes11d86e2e12ee\tidyverse-ggplot2-dbd7d79/DESCRIPTION' ... OK
E> * preparing 'ggplot2':
  E> * checking DESCRIPTION meta-information ... OK
E> * checking for LF line-endings in source and make files and shell scripts
E> * checking for empty or unneeded directories
E> * building 'ggplot2_3.3.3.9000.tar.gz'
E>

Other attempts:

  • Thinking it might have to do with permissions to access the temporary directory, I tried running this from RStudio opened as admin, but problem persisted.

  • I also tried adding a new temporary directory, and specifying this in both the .Renviron file and a new Renviron.site in C:\Users\Ava\Documents (TMPDIR = C:\rtemp). RStudio run as admin still threw same errors.

  • Thinking it may have come from the fact that I had two versions of R installed (3.6 and 4.0), I uninstalled R 3.6, restarted R, but same error when I tried with devtools::install_github("rmcelreath/rethinking").

  • I tried adding the Rcmd.exe file directly to the path, still no luck:

\usr\bin
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64
C:\Program Files\R\R-4.0.2\bin\x64\Rcmd.exe
C:\rtools40\usr\bin
C:\rtools40\mingw64\bin
  • Removed Anaconda from my path, thinking a possible duplicate of R executable might be causing the problem, still no luck.

  • Although my wd() is not in a OneDrive folder, I paused syncing and closed, as previous users has a problem with OneDrive sync messing with R.

Thanks for any tips!

Ava
  • 157
  • 1
  • 7
  • I am also looking for the answer to this, did you ever figure it out @ava? – joelostblom Sep 04 '21 at 20:04
  • 1
    Hi there, unfortunately I did not. After uninstalling and re-installing R, RStudio, Rtools, and relevant packages, and each time making sure executables and so on were all findable, I still couldn't get it to work. In the end, my hypothesis is that there is some fundamental way in which the low-level IT privileges on my computer were preventing this from working (my computer is a work computer and came pre-loaded with an admin layer to which I theoretically had access privileges). Sorry for not being of more help! If you find another solution, do feel free to post. – Ava Oct 01 '21 at 08:19
  • Thanks for the reply! In the end I had to do a factory restore of that computer, which fixed the issue. In case anyone else comes across this, there are some more details in https://github.com/r-lib/devtools/issues/2315 and https://community.rstudio.com/t/system-command-rcmd-exe-failed-exit-status-1-stdout-stderr-empty/114538 – joelostblom Oct 01 '21 at 18:38

0 Answers0