installation of package ‘RCurl’ had non-zero exit status

Viewed 5403

I am trying to install RCurl on OS X 10.12.6 but get the following error:

Error: package or namespace load failed for ‘RCurl’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so':
  dlopen(/Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so, 6): Library not loaded: @rpath/libcurl.4.dylib
  Referenced from: /Users/nick/Library/R/3.4/library/RCurl/libs/RCurl.so
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/nick/Library/R/3.4/library/RCurl’

The downloaded source packages are in
    ‘/private/var/folders/hx/9xx9fwq91t95k45dzlmzxfy40000gp/T/Rtmp14zSi1/downloaded_packages’
Warning message:
In install.packages("RCurl") :
  installation of package ‘RCurl’ had non-zero exit status

This error has been discussed a bit already, but the solutions are all specific to linux and I don't think they are relevant to OS X. I did try installing the homebrew version of curl but that didn't help.

Any ideas? I think that more debugging information would be helpful, but I'm not sure what else to provide.

Thanks in advance! Nick

3 Answers

If someone face the same problem in Ubuntu just as I do, the solution is run first in terminal:

sudo apt-get install libcurl4-gnutls-dev

Then in R:

install.packages('RCurl')

In case it is useful for anyone else with this issue, I solved it without having to install the cran binary of R. (I use the homebrew version because it allows you to use faster BLAS options that take advantage of parallelism). Steps were:

  1. Make sure that R doesn't find the homebrew or anaconda versions of curl-config (this will only affect the current R session)

    PATH=/usr/bin/:$PATH
    
  2. Download and install latest version of RCurl from http://www.omegahat.net/RCurl/ (replace <RCURLVERSION> with the current latest version)

    wget http://www.omegahat.net/RCurl/RCurl_<RCURLVERSION>.tar.gz
    R CMD INSTALL RCurl_<RCURLVERSION>.tar.gz
    
Related