Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing packages from github

Tags:

github

r

I can't install packages from github:

> install_github('cranvas', 'ggobi', args="--no-multiarch")
Installing github repo(s) cranvas/master from ggobi
Installing cranvas.zip from https://github.com/ggobi/cranvas/archive/master.zip
Error in function (type, msg, asError = TRUE)  : couldn't connect to host

this is my session:

R version 3.0.1 (2013-05-16)
Platform: x86_64-pc-linux-gnu (64-bit)

NB: install.packages works as usual, it's just with github the issue. Have some of you ever faced this? Thanks

like image 406
Michele Avatar asked May 24 '13 17:05

Michele


3 Answers

I had the same problem and I used this and it worked for me

    library(downloader)
    download("https://github.com/ropensci/plotly/archive/master.tar.gz", "plotly.tar.gz")
    install.packages("plotly.tar.gz", repos = NULL, type = "source")
like image 169
David Chow Avatar answered Oct 16 '22 04:10

David Chow


from : http://healthvis.org/install/

Some users have run into the following error when using the instructions above: Error in function (type, msg, asError = TRUE) : couldn't connect to host. This is likely due to the use of proxies (which would prevent you from installing any package from github), and can be rectified using the httr package. Run the following commands before install_github(...) above:

install.packages("httr")
library(devtools)
library(httr)
set_config(use_proxy(url="http://proxyname.company.com",port=8080,username="XXX",password="XXX")) 
install_github("cranvas")

Hope this helps.

like image 7
Roger Avatar answered Oct 16 '22 04:10

Roger


GitHub no longer supports HTTP. That was disabled quite some years ago and it may have been aligned with mitigation of FireSheep. My test was as follows:

curl -i http://github.com/ggobi/cranvas/archive/master.zip
HTTP/1.1 301 Moved Permanently
Server: GitHub.com
Date: Mon, 26 Aug 2013 03:15:17 GMT
Content-Type: text/html
Content-Length: 178
Connection: close
Location: https://github.com/ggobi/cranvas/archive/master.zip
Vary: Accept-Encoding

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Note the 301 and HTTPS as the replacement URL.

like image 2
Matthew McCullough Avatar answered Oct 16 '22 02:10

Matthew McCullough