简体   繁体   中英

Error installing packages from github

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

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.

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")

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM