R shiny - version conflict with package in system library on shiny server
We have a shiny server where we can deploy our shiny apps, this has a system/default library path (/usr/lib64/R/library) which is only writable for the admins, not me.
I use my own library paths for the apps I make, setting them using .libPaths()
However, when accessing the shiny app through the browser it needs (and loads) the shiny package residing in the system path before getting to my .libPaths() method. This on it's turn loads rlang but the rlang version is too old for one of my packages.
So once my packages start loading (using the path I set using .libPAths()) I get an error:
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 1.1.2 is already loaded, but >= 1.1.7 is required
Execution halted
I have tried reloading and also detaching (unloading) the old package, but this gives other issue due to the package being used by shiny (and others)
Error in detach(c("ellipsis", "lifecycle", "htmltools", "shiny"), unload = T) :
invalid 'name' argument
Calls: <Anonymous> ... sourceUTF8 -> eval -> eval -> ..stacktraceon.. -> detach
Execution halted
Is there something I can do about this? Or does the admin really need to update the system wide packages.
Reason for using a library folder per shiny app is to prevent conflicts so I would really like to be able to somehow force it that way instead of needing to install/update system wide packages.
If I manually launch it from the terminal giving the .libPaths() command as an extra argument it seems to launch fine (can't access it through the browser though) but I can't do this when accessing it through the browser:
R -e ".libPaths('/srv/shiny-server/library/myapp/'); shiny::runApp('myapp')"
Any ideas?