简体   繁体   English

从github安装包时出错

[英]Error installing packages from github

I can't install packages from github: 我无法从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. 注意: install.packages像往常一样工作,它只是与github问题。 Have some of you ever faced this? 有没有人遇到过这个? Thanks 谢谢

from : http://healthvis.org/install/ 来自: 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. 使用上述说明时,某些用户遇到以下错误:函数错误(type,msg,asError = TRUE):无法连接到主机。 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. 这可能是由于使用代理(这会阻止您从github安装任何软件包),并且可以使用httr软件包进行纠正。 Run the following commands before install_github(...) above: 在上面的install_github(...)之前运行以下命令:

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. GitHub不再支持HTTP。 That was disabled quite some years ago and it may have been aligned with mitigation of FireSheep . 这种情况在几年前就被禁用了,它可能与缓解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. 请注意301和HTTPS作为替换URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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