6

I installed Xcode on my Mac, running on the El Capitan version 10.11. I need to get files from a github repository to my workspace in R, so I run the line:

devtools::install_github("Myrepository")

And this error appears:

Downloading GitHub repo Myrepository
from URL https://api.github.com/repos/Myrepository/func/zipball/master
Erreur : Could not find build tools necessary to build func

I thought the problem may come from my gcc command line tools, but when I hit

gcc -v

I have it installed:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix

Any ideas?

rawr
  • 20,481
  • 4
  • 44
  • 78
Helenatodd
  • 71
  • 1
  • 4
  • did you install the xcode command line tools – rawr Mar 10 '16 at 12:36
  • Yes I did, from this site : https://developer.apple.com/downloads/ – Helenatodd Mar 11 '16 at 13:36
  • `devtools::has_devel()` returns TRUE for you and it doesn't work for `devtools::install_github("username/Myrepository")` using the username? – rawr Mar 11 '16 at 17:16
  • Exactly. But before the "TRUE" message, I get this line when I run devtools::has_devel() '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore CMD \ SHLIB foo.c – Helenatodd Mar 14 '16 at 08:16
  • I am receiving a similar message (but I am using windows), any luck finding a fix? "C:/PROGRA~1/R/R-32~1.5/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet \ CMD SHLIB foo.c – Scott Worland May 06 '16 at 11:49
  • See related [question](http://stackoverflow.com/questions/35096233/error-could-not-find-build-tools-necessary-to-build-dplyr) `brew link readline --force` solved it for me – s-v-r Jul 23 '16 at 00:18

1 Answers1

2

I had the same problem when installing the forecast package from GitHub on my Mac running El Capitan. The suggested readline fix above did not work for me. I noticed that my shell wasn't seeing R (e.g. when I typed R at a shell prompt it said command not found). I also was operating as a non-admin user of my computer and I think had installed R as a non-admin user. So I downloaded R again (same version) and installed it as an admin user. (This was based on a hunch after reading about some of the finnicky issues with R and paths in El Cap) After reinstalling R as an admin user I could then open R in a terminal, and at that point devtools::install_github("robjhyndman/forecast") worked fine.

Community
  • 1
  • 1
Nicholas G Reich
  • 1,028
  • 10
  • 21
  • Indeed, I recently changed my computer and am now its admin, I have no more issues installing content from github. Tanks for your help! – Helenatodd Sep 27 '16 at 07:20
  • I will also add that on another machine I had the same problem. On this machine I have been admin user forever and I think the issue was that I had not reinstalled R after upgrading to Mac OS X 10.11 (El Capitan). After reinstalling R (same version even, just a fresh install) then the terminal could see R and the install_github command worked. – Nicholas G Reich Oct 06 '16 at 13:43