首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >函数中的devtools::install_github错误(类型,msg,asError = TRUE):<not set>

问函数中的devtools::install_github错误(类型,msg,asError = TRUE):<not set>
EN

Stack Overflow用户
提问于 2014-04-25 08:13:09
回答 3查看 7.3K关注 0票数 8

我第一次尝试通过devtools::install_github安装一个软件包

代码语言:javascript
复制
l@np350v5c:~$ R --vanilla
> library(devtools)

Attaching package: ‘devtools’

The following objects are masked from ‘package:utils’:

    ?, help

The following object is masked from ‘package:base’:

    system.file

> search()
 [1] ".GlobalEnv"        "package:devtools"  "package:stats"    
 [4] "package:graphics"  "package:grDevices" "package:utils"    
 [7] "package:datasets"  "package:methods"   "Autoloads"        
[10] "package:base"

但是,例如

代码语言:javascript
复制
> install_github("devtools")
Installing github repo devtools/master from hadley
Downloading master.zip from https://github.com/hadley/devtools/archive/master.zip
Errore in function (type, msg, asError = TRUE)  : <not set>

traceback()的输出是

代码语言:javascript
复制
> traceback()
12: fun(structure(list(message = msg, call = sys.call()), class = c(typeName, 
        "GenericCurlError", "error", "condition")))
11: function (type, msg, asError = TRUE) 
    {
        if (!is.character(type)) {
            i = match(type, CURLcodeValues)
            typeName = if (is.na(i)) 
                character()
            else names(CURLcodeValues)[i]
        }
        typeName = gsub("^CURLE_", "", typeName)
        fun = (if (asError) 
            stop
        else warning)
        fun(structure(list(message = msg, call = sys.call()), class = c(typeName, 
            "GenericCurlError", "error", "condition")))
    }(77L, "<not set>", TRUE)
10: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding, 
        PACKAGE = "RCurl")
9: curlPerform(curl = handle$handle, .opts = curl_opts$values)
8: make_request("get", hu$handle, hu$url, config = config)
7: GET(url, config)
6: (function (url, name = NULL, subdir = NULL, config = list(), 
       before_install = NULL, ...) 
   {
       if (is.null(name)) {
           name <- basename(url)
       }
       message("Downloading ", name, " from ", url)
       bundle <- file.path(tempdir(), name)
       request <- GET(url, config)
       stop_for_status(request)
       writeBin(content(request), bundle)
       on.exit(unlink(bundle), add = TRUE)
       install_local_single(bundle, subdir = subdir, before_install = before_install, 
           ...)
   })(dots[[1L]][[1L]], dots[[2L]][[1L]], subdir = NULL, config = list(), 
       before_install = function (bundle, pkg_path) 
       {
           desc <- file.path(pkg_path, "DESCRIPTION")
           DESCRIPTION <- readLines(desc, warn = FALSE)
           if (any(DESCRIPTION == "")) {
               DESCRIPTION <- DESCRIPTION[DESCRIPTION != ""]
           }
           cat(DESCRIPTION, file = desc, sep = "\n")
           append_field <- function(name, value) {
               if (!is.null(value)) {
                   cat("Github", name, ":", value, "\n", sep = "", 
                     file = desc, append = TRUE)
               }
           }
           append_field("Repo", conn$repo)
           append_field("Username", conn$username)
           append_field("Ref", conn$ref)
           append_field("SHA1", github_extract_sha1(bundle))
           append_field("Pull", conn$pull)
           append_field("Subdir", conn$subdir)
           append_field("Branch", conn$branch)
           append_field("AuthUser", conn$auth_user)
       }, dependencies = TRUE)
5: mapply(install_url_single, url, name, MoreArgs = list(subdir = subdir, 
       config = config, before_install = before_install, ...))
4: install_url(conn$url, subdir = conn$subdir, config = conn$auth, 
       before_install = github_before_install, ...)
3: FUN("devtools"[[1L]], ...)
2: vapply(repo, install_github_single, FUN.VALUE = logical(1), username, 
       ref, pull, subdir, branch, auth_user, password, auth_token, 
       ..., dependencies = TRUE)
1: install_github("devtools")

我尝试了另一个回购,但它的行为方式相同。

有什么暗示吗?

代码语言:javascript
复制
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=it_IT.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=it_IT.UTF-8        LC_COLLATE=it_IT.UTF-8    
 [5] LC_MONETARY=it_IT.UTF-8    LC_MESSAGES=it_IT.UTF-8   
 [7] LC_PAPER=it_IT.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=it_IT.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.5

loaded via a namespace (and not attached):
[1] digest_0.6.4   evaluate_0.5.1 httr_0.2       memoise_0.1    parallel_3.1.0
[6] RCurl_1.95-4.1 stringr_0.6.2  tools_3.1.0    whisker_0.3-2 
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-06-02 16:13:58

实际上,我也遇到了同样的问题,在安装RCurl之后,它就成功了。

为了在ubuntu中安装RCurl,在您的终端中编写以下内容:

代码语言:javascript
复制
sudo apt-get install libcurl4-openssl-dev

然后在R:

代码语言:javascript
复制
install.packages('RCurl')

就这样!

票数 22
EN

Stack Overflow用户

发布于 2014-08-28 17:22:59

如果无法安装适当版本的libcurl,可以尝试使用"install_git“函数而不是"install_github”函数。例如,

代码语言:javascript
复制
library(devtools)
install_git("https://github.com/hadley/devtools.git")

对我起作用了。

票数 4
EN

Stack Overflow用户

发布于 2015-09-07 16:08:39

对不起,这是Debian中的错误包中的r-cran-rcurl。我们最终在Debian发行版unstable、testing和最近的stable (Jessie8.2)中对其进行了更正。在Ubuntu中,它是用wily修复的。对不起,这个问题,并感谢使用Debian或其衍生物!

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23287685

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档