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

后端 未结 2 998
余生分开走
余生分开走 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:38

    Upgrade your RStudio version to the latest one, should work in any OS.

    For Linux/Ubuntu 14.04 terminal users, simply do:

    sudo apt-get remove rstudio
    
    wget https://download1.rstudio.org/rstudio-0.99.489-amd64.deb
    
    sudo dpkg -i rstudio-0.99.489-amd64.deb
    

    Now, run RStudio. The error message should disappear.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题