R Shiny Server Installation Package

Possible match:
No packages on the brilliant server
R brilliant / brilliant server - packet search problem
R - How to set the path for install.packages () for a brilliant server? - ubuntu

I tried and read all of the above, but still can not get my brilliant server to work at all.

I followed the installation instructions for http://www.rstudio.com/shiny/server/install-opensource , including a system-wide installation of the brilliant package:

$ sudo su - \ -c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\"" 

The brilliant server is installed correctly and working,

 ~# sudo start shiny-server start: Job is already running: shiny-server 

but when I go to domain:3838 , I see a greeting on the shiny error page

Error in eval(expr, envir, enclos) : The Shiny package was not found in the library. Ensure that Shiny is installed and is available in the Library of the user you're running this application as. Calls: local -> eval.parent -> eval -> eval -> eval -> eval Execution halted

Opening R, install.packages('shiny', repos='http://cran.rstudio.com/') , and then library(shiny) or any other package, tells me that it cannot be found.

I am really stuck, not only cannot install / download any packages, I cannot find where they are going.

EDIT:
install.packages(c("geonames"))
Installing package into '/usr/local/lib/R/site-library' (as 'lib' is unspecified)

> library()
Warning message:
In library() :
libraries '/usr/local/lib/R/site-library', '/usr/lib/R/site-library' contain no packages

AND

 > installed.packages()[,1:2] Package LibPath base "base" "/usr/lib/R/library" boot "boot" "/usr/lib/R/library" class "class" "/usr/lib/R/library" cluster "cluster" "/usr/lib/R/library" codetools "codetools" "/usr/lib/R/library" compiler "compiler" "/usr/lib/R/library" datasets "datasets" "/usr/lib/R/library" foreign "foreign" "/usr/lib/R/library" graphics "graphics" "/usr/lib/R/library" grDevices "grDevices" "/usr/lib/R/library" grid "grid" "/usr/lib/R/library" KernSmooth "KernSmooth" "/usr/lib/R/library" lattice "lattice" "/usr/lib/R/library" MASS "MASS" "/usr/lib/R/library" Matrix "Matrix" "/usr/lib/R/library" methods "methods" "/usr/lib/R/library" mgcv "mgcv" "/usr/lib/R/library" nlme "nlme" "/usr/lib/R/library" nnet "nnet" "/usr/lib/R/library" parallel "parallel" "/usr/lib/R/library" rpart "rpart" "/usr/lib/R/library" spatial "spatial" "/usr/lib/R/library" splines "splines" "/usr/lib/R/library" stats "stats" "/usr/lib/R/library" stats4 "stats4" "/usr/lib/R/library" survival "survival" "/usr/lib/R/library" tcltk "tcltk" "/usr/lib/R/library" tools "tools" "/usr/lib/R/library" utils "utils" "/usr/lib/R/library" 

Any help is appreciated


SessionInfo:

> .libPaths() [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" [3] "/usr/lib/R/library"

 > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base 
+6
source share
4 answers

The problem is that the brilliant server cannot find the packages you are installing, because it runs them as another user named shiny . This user is created when shiny-server is installed.

The easiest (and safest IMHO) way to solve this problem is to install the necessary packages using this user account (brilliant). This can be done by following these steps.

  • Set the password for the shiny user account using sudo passwd shiny , enter and confirm the password
  • Switch to a brilliant account using: su - shiny
  • Call R with R (without sudo)
  • Install the necessary packages, in this case: install.packages("shiny")

Please note that if you have rstudio-server installed on one computer, you can perform steps 2-4 using this interface. Just go to the same / ip domain and use: 8787 for the rstudio-server interface instead of: 3838 for a brilliant server.

Adapted from my answer here

+4
source

I had a similar problem. After reading the admin guide, there may be a solution for you.

You have this error because anyone who has access to the application does not have the shiny package installed. If you run less /etc/shiny-server/shiny-server.conf , and you can notice the following in the first two lines:

 # Instruct Shiny Server to run applications as the user "shiny" run_as shiny; 

To fix the problem, you can do one of the following:

  • Switch to the shiny user and install all the packages there. e.g. su shiny . However, this will lead to duplication of the libraries you have installed for all users.
  • The clean way is to always run shiny from another user with all the packages by editing run_as in /etc/shiny-server/shiny-server.conf . In this case, you can change the second line to run_as your_username shiny; so that it .libPaths() for your .libPaths() and then the brilliant .libPaths() . You can also add multiple users here.
+2
source

I had similar troubles. Worked after I did the following instead of installing a single line of the package:

 sudo su R 

then in R do:

 install.packages('shiny', repos='http://cran.rstudio.com/') library(shiny) 
0
source

I am also new to Ubuntu and had similar problems. In my case, the problem was that the R packages were installed in folders belonging to the ubuntu user. However, they must be accessible to the root.

I changed the user to "root" using the appropriate command, and then executed the install.packages function from R

 sudo -i R 

Hope this helps you on your way. At least your problem is not unique. I found a lot of good advice just by killing a little. For instance:.

http://freigeist.devmag.net/r/773-deploying-shiny-server-on-amazon-some-troubleshoots-and-solutions.html

0
source

Source: https://habr.com/ru/post/969689/


All Articles