Error when trying to load a shiny app after trying to install the devtools version

Im facing an unusual error when trying to load a shiny app which was working fine until I tried to install shiny from devtools::install_github("rstudio/shiny") while until recently I was using the CRAN version. The devtools installation failed and now I cannot even load my shiny app even when Im trying to use a different working directory with shiny installed from CRAN. Specifically I get :

shiny::runApp()
Error: .onLoad failed in loadNamespace() for 'shiny', details:
  call: .Call("_httpuv_getRNGState", PACKAGE = "httpuv")
  error: "_httpuv_getRNGState" not available for .Call() for package "httpuv"

Any ideas?

I had the same problem and what I did was update all the packages with the function

update.packages()

Next I reinstalled the library "shiny" ;

install.packages("shiny", repos = c("http://rstudio.org/_packages", "http://cran.rstudio.com"))

I answered "yes" to the question
"Do you want to install from sources the package which needs compilation?"
And the error disappeared.

2 Likes

you may need to run update.packages() multiple times due to errors caused by missing libraries depending on your OS. so you will be better off passing ask=FALSE. update.packages(ask=FALSE)

1 Like

For future reference, this is the same as: https://github.com/rstudio/shiny/issues/2054

The solution for that user was to run:

install.packages("Rcpp")
install.packages("httpuv")
install.packages("shiny")
2 Likes