'How to use two ruby,rails version on same machine but different project?
Right now I have a project demo on my Desktop with versions
Ruby-2.6.3p62
Rails-4.2.11.3
Gem-3.0.3
and I want to create an another project new on my Desktop with versions
ruby-3.1.1p18
Rails-7.0.2.3
Gem-3.3.13
and currently, I have this rbenv version
rbenv version
2.6.3 (set by /home/akshit/.rbenv/version)
Can you share the commands on how to create project new without affecting my project demo?
Solution 1:[1]
Using rbenv do this:
- create
project new - open a terminal inside root folder
- write
rbenv install 3.1.1and thenrbenv local 3.1.1so for this project it will use the specified version
I suggest you to create a .ruby-version file where you set the project's ruby version, in this case 3.1.1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Joe |
