11

我无法从 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

这是我的会议:

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

注意:install.packages像往常一样工作,这只是 github 的问题。你们中的一些人曾经遇到过这种情况吗?谢谢

4

3 回答 3

8

我遇到了同样的问题,我使用了它,它对我有用

    library(downloader)
    download("https://github.com/ropensci/plotly/archive/master.tar.gz", "plotly.tar.gz")
    install.packages("plotly.tar.gz", repos = NULL, type = "source")
于 2014-07-16T13:38:47.717 回答
7

来自:http ://healthvis.org/install/

一些用户在使用上述说明时遇到了以下错误: 函数错误(类型,msg,asError = TRUE):无法连接到主机。这可能是由于使用了代理(这会阻止您从 github 安装任何包),并且可以使用 httr 包进行纠正。在上面的 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")

希望这可以帮助。

于 2013-09-04T07:26:17.290 回答
2

GitHub 不再支持 HTTP。这在几年前就被禁用了,它可能与FireSheep 的缓解措施一致。我的测试如下:

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>

请注意 301 和 HTTPS 作为替换 URL。

于 2013-08-26T03:19:43.383 回答