rsession-ld-library-path equivalent for Shiny-Server?

192 views
Skip to first unread message

Richard Schuster

unread,
Feb 12, 2016, 10:07:49 AM2/12/16
to Shiny - Web Framework for R
Hi all,

One of my shiny apps relies on an R package that uses an external library outside of the standard R library search paths.

If I open a standard R session and load the package on my Ubuntu Server (14.04) everything works, the package loads and the functions produce results.

When I tried the same thing via RStudio Server I got this error message:

Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/site-library/gurobi/libs/gurobi.so': libgurobi65.so: cannot open shared object file: No such file or directory


I was able to resolve this problem by following the recommendation here: http://www.gurobi.com/documentation/6.5/quickstart_linux/r_installing_the_r_package.html

If you are using R from RStudio Server, and you get an error indicating that R is unable to load the Gurobi DLL or shared object, you may need to set the rsession-ld-library-path entry in the server config file. Please consult the RStudio documentation for more information.

So I set rsession-ld-library-path to the appropriate path and the package works from RStudio Server as well. If I start my Shiny app from within RStudio Server it works too.

If I use Shiny-Server I get the same error message as above (all my other Shiny apps work fine). Now I am wondering if there is an equivalent to rsession-ld-library-path for Shiny-Server or if I am missing something else here that Shiny is doing?

I have tried adding a library path via my global.R on line 1:
.libPaths(c("/opt/gurobi650/linux64/lib",.libPaths()))
but that didn't do any good either.

Thanks very much for your help,
Richard

Richard Schuster

unread,
Feb 15, 2016, 12:47:58 PM2/15/16
to Shiny - Web Framework for R
Just in case anyone else runs into this problem in the future:
It looks like this stackoverflow post provides the solution.

I have tried it for my app and so far its working.
Reply all
Reply to author
Forward
0 new messages