Install libraries for Shiny Server

705 views
Skip to first unread message

rohan1925

unread,
Jun 25, 2015, 1:20:59 PM6/25/15
to shiny-...@googlegroups.com
Hi all,

I am creating shiny applications and am able to render them locally as I have the required libraries installed.
But when I upload them on the server, I get this error:




The application failed to start.

The application exited during initialization.

Error in library(d3heatmap) : there is no package called ‘d3heatmap’ Calls: runApp ... sourceUTF8 -> source -> withVisible -> eval -> eval -> library Execution halted







I have the following command for installing libraries in my global.r script if its not present.Let me know if I should keep it elsewhere..

if (!require("devtools")) install.packages("devtools")
devtools::install_github("rstudio/d3heatmap")

Dean Attali

unread,
Jun 26, 2015, 1:13:12 AM6/26/15
to shiny-...@googlegroups.com
It's probably because the package is available to your user but not to the shiny user.  It's very important when using shiny server to understand which user is being used and how each user can have their own R library. 

Read this section in the docs

Unless you edited the default config file, the user running the app is `shiny`. So you need to make sure the packages requires are available in shiny's R library. You can do that in several ways, for example log in as `root` and install the package will usually work

Dean Attali

unread,
Jun 26, 2015, 1:15:14 AM6/26/15
to shiny-...@googlegroups.com
Sorry I missed the end bit of your post showing the code inside global.R.  Not sure then. I'd still try to see if the shiny user has the package installed in their library path

Joe Cheng

unread,
Jun 26, 2015, 2:21:52 AM6/26/15
to Dean Attali, shiny-...@googlegroups.com
Probably the install.packages calls in global.R are not succeeding because the shiny user doesn't have a user library, which is created the first time you install a package interactively. Can you try (or ask your administrator to try) changing to the Shiny user ("sudo su shiny"), then launching R, and installing a package (any package) manually?

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/7ec9a24d-68fe-4508-980a-2c8600410668%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages