What does “Error in tools:::httpdPort <= 0L : …” in Rstudio means?

后端 未结 2 1008
余生分开走
余生分开走 2021-01-11 19:50

I have upgraded R to version 3.2.2. When I restart Rstudio, before \">\" is shown, there is an error message:

Error in tools:::httpdPort <= 0L :
        c         


        
2条回答
  •  攒了一身酷
    2021-01-11 20:51

    I just encountered the same problem today and searched through the source code to understand the origin. The reason is that until R 3.1.3, httpdPort was a variable, while since R 3.2.0, it is a function.

    The error occurs, because the line

    tools:::httpdPort <= 0L
    

    is wrong, if httpdPortis a function. It should rather be

    tools:::httpdPort() <= 0L
    

    It seems that RStudio runs that line at some point and of course, it needs to know, which of the two versions to run. This is why RStudio needs to be updated after R is updated from a version <= 3.1.3 to a version >= 3.2.0.

    The httpdPort is defined in the file src/library/tools/R/dynamicHelp.R. In R version 3.1.3, the definition reads

    httpdPort <- 0L
    

    while in R version 3.2.0, it is

    httpdPort <- local({
        port <- 0L
        function(new) {
            if(!missing(new))
                port <<- new
            else
                port
        }
    })
    

    To solution to the problem is thus to either downgrade your R version to <= 3.1.3 or to upgrade RStudio.

提交回复
热议问题