r-lib / rig

The R Installation Manager
MIT License
629 stars 22 forks source link

Multiple RStudio sessions with different R versions (feature request) #222

Open paluigi opened 5 months ago

paluigi commented 5 months ago

Hello, I recently discovered rig, and I love the project! (I come from the Python worlds, and I am addicted to pyenv)

I have several projects (organized with renv) that use different versions of R. If I launch RStudio with rig rstudio 4.3.3, then all other sessions that I open in RStudio will use the same version of R.

However, until RStudio is open I cannot launch another session (for instance, with rig rstudio 4.1.3). If I launch this command from the terminal it seems there is no effect.

It would be great if we could be able to launch multiple sessions of RStudio, each one with its own R version.

I use Ubuntu 22.04 (x64), RStudio 2023.06.0 Build 421

gaborcsardi commented 5 months ago

Are you using the latest version of rig? If not, can you upgrade?

paluigi commented 5 months ago

I tried to upgrade, but I get this message after sudo apt update and sudo apt upgrade: r-rig is already the newest version (0.6.0-1).

If I also install the tarball will I have issues for future upgrades?

gaborcsardi commented 5 months ago

For now, please get the DEB package from here: https://github.com/r-lib/rig/releases/tag/v0.7.0

paluigi commented 5 months ago

OK, I upgraded using the release deb. If I open RStudio using rig rstudio /path/to/renv.lock it opens multiple RStudio sessions when I open different projects.
However, if I want to open different RStudio sessions with different R versions without a project (like the example above, runing first rig rstudio 4.3.3 and then rig rstudio 4.1.3) , the second command has no effects.

I can live with the lock file solution for my purposes, I only need to create the renv files at the beginning of the project (which I usually do anyway).

gaborcsardi commented 5 months ago

OK, then this is definitely a bug, and we'll fix it.