0
votes

I have installed and running my shiny app on shiny server. However, shiny server does not recognize functions from knitr and shinyBS package. When I remove the code related to these two packages, the app shows up in the browser correctly.

Also, when I run the app locally using runApp() from the command prompt, everything is fine(including knitr and shinyBS).

I have installed knitr and shinyBS in /usr/local/lib/R/site-library.

let me know if you need any other info.

Thanks

2

2 Answers

1
votes

When you install R packages for Shiny Server, you need to start R via sudo R, so that the packages are installed to a system library, instead of the current user's library.

1
votes

this is a workaround but I just tried it and it worked.

If you have ssh access to the shiny server you can change the shiny user and install the packages (you need to exec R with sodu R). I had problems with the shiny user. That is why I altered the shiny-server config and just changed the shiny user to the local su (I am sure that this is not the best or safest way but it worked).

So, what it did was:

  1. Change the shiny user in shiny-server.conf from run_as shiny; to run_as yourUserName;

  2. Just enter su yourUserName and sudo R

  3. Now install your packages with install.packages("PackageName")

best regards

Nico