9

I'm getting the following error when installing packages from github:

> devtools::install_github("pmartinezarbizu/pairwiseAdonis/pairwiseAdonis")
Downloading GitHub repo pmartinezarbizu/pairwiseAdonis@HEAD
Erro: Failed to install 'pairwiseAdonis' from GitHub:
  System command 'Rcmd.exe' failed, exit status: -1, stdout + stderr empty

With find_rtools, I get the following message (I was reading these posts, but couldn't solve my problem: https://github.com/r-lib/devtools/issues/2031 and R CMD check not looking for gcc in Rtools directory):

> find_rtools(T)
Scanning R CMD config CC...
cc_path:  
'' does not exist
Scanning path...
ls: C:\Rtools\bin\ls.exe 
gcc_path: C:\Rtools\mingw_64\bin\gcc.exe 
VERSION.txt
Rtools version 3.5.0.4 
Version: 3.5 
Found compatible gcc on path
[1] TRUE

I'm using R v. 3.6.:

>     > session_info()
>     - Session info -------------------------------------------------------------------------------------
>      setting  value                       
>      version  R version 3.6.3 (2020-02-29)
>      os       Windows 10 x64              
>      system   x86_64, mingw32             
>      ui       RStudio                     
>      language (EN)                        
>      collate  Portuguese_Brazil.1252      
>      ctype    Portuguese_Brazil.1252      
>      tz       America/Sao_Paulo           
>      date     2020-07-29
  • You need to add the R bin directory to your PATH. It is something like `file.path(R.home(), "bin/x64")`. (Use `list.files()` to make sure `Rcmd.exe` is there to confirm.) – user2554330 Jul 29 '20 at 23:47
  • What version of `devtools` are you running? – MrFlick Jul 29 '20 at 23:49
  • 1
    Devtools v. 2.3.1 I did try to include what I thought was necessary in the PATH. I think the problem is with my PATH variables, but I am afraid to make things worse by removing things. These are the variables there (but there are more, e.g. python): > Sys.getenv('PATH') [1] "C:\\usr\\bin;C:\\Program Files\\R\\R-3.6.3\\bin\\x64; C:\\Rtools\\bin; C:\\RBuildTools\\3.5\\bin; C:\\Rtools\\bin;C:\\Rtools\\mingw_64\\bin; C:\\Rtools\\mingw_64\\bin\\gcc; C:\\Program Files\\R\\R-3.6.3\\bin\\x64; C:\\Program Files\\R\\R-3.6.3\\bin\\x64\\Rcmd.exe; C:\\Program Files\\R\\R-3.6.3\\bin – Thiago DeRoure BandeiradeMello Jul 30 '20 at 10:07
  • Working answers at https://stackoverflow.com/questions/57777382/cannot-install-an-r-package-from-github – hmhensen Jul 16 '21 at 20:09

1 Answers1

3

If anyone's still having this problem, I was able to work around it using the pak package with the pkg_install function. It's possible this might not work for all package repositories, but it has worked for the ones I've needed it for.

James Bang
  • 31
  • 4