rig icon indicating copy to clipboard operation
rig copied to clipboard

Multiple RStudio sessions with different R versions (feature request)

Open paluigi opened this issue 2 years ago • 6 comments

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

paluigi avatar Apr 10 '24 20:04 paluigi

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

gaborcsardi avatar Apr 10 '24 20:04 gaborcsardi

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?

paluigi avatar Apr 11 '24 12:04 paluigi

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

gaborcsardi avatar Apr 11 '24 12:04 gaborcsardi

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).

paluigi avatar Apr 11 '24 13:04 paluigi

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

gaborcsardi avatar Apr 11 '24 13:04 gaborcsardi

For now, despite rig rstudio 4.3.3 not currently working as intended, specifying the project file does work (just like in does passing the renv file): rig rstudio path/to/myProject.Rproj 4.3.3.

achubaty avatar Nov 19 '24 04:11 achubaty