Not able to overwrite the Global Environmental variable for Rstudio Server Pro

I recently installed Rstudio server pro & new version of Gurobi. In the previous version i could able to setup the Global Environmental variable. After the upgrade added the rsession-ld-library-path in /etc/rstudio/rserver.conf file & restarted the Rserver. It's not working in Rstudio IDE & it works in R Server session. How to setup the environmental variable so that it works in IDE as well?

Thanks.

Do you mind explaining a bit more about what you are trying to do? If you can share a specific example (i.e. have the R session start with the MY_VARIABLE env var set to the value blah), that can be helpful to answering your question and solving your problem.

In any case, it sounds like you are trying to set an environment variable for all users on the server. There are a few ways to do this. This section of the admin guide might be helpful.

In particular, rsession-ld-library-path only affects the LD_LIBRARY_PATH environment variable, but can be useful if that is what you are trying to edit. What you may be looking for instead is setting global variables in /etc/environment or customizing the startup of R itself with .Renviron, Renviron.site, or something of that nature (note that this configuration needs to be done for each installed version of R):

This article should be helpful on that front

If your question is more about the implementation of Gurobi, that would be helpful to have some clarification about as well. I for one am unfamiliar with Gurobi and what it takes to make it work.

@cole Thanks for the reply.
I am trying to setup Gurobi with R studio for all the users. Based on the admin document I added the rsession-ld-library-path in the config file. I have edited .Renviron file from my home directory it works. I want to set up for all the user. I am not able to find .Renviron file from the R installation directory. So i edited /etc/rstudio/rserver.conf file.

Per the article that I mentioned, you should be able to move your .Renviron file that is working to R_HOME/etc/Renviron.site, and it will then affect all users.

To determine where this is, you can start R and then type Sys.getenv("R_HOME"). For instance, if I got:

Sys.getenv("R_HOME")
#> [1] "/opt/R/3.4.3"

Then I would edit this file in /opt/R/3.4.3/etc/Renviron.site

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.