[英]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现在我的Desktop
上有一个带有版本的project demo
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我想在我的Desktop
上创建另一个带有版本的project new
ruby-3.1.1p18
Rails-7.0.2.3
Gem-3.3.13
and currently, I have this rbenv
version目前,我有这个rbenv
版本
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
?您能否分享有关如何在不影响我的project demo
的情况下创建project new
的命令?
Using rbenv do this:使用 rbenv 这样做:
project new
project new
rbenv install 3.1.1
and then rbenv local 3.1.1
so for this project it will use the specified version写rbenv install 3.1.1
然后rbenv local 3.1.1
所以对于这个项目它将使用指定的版本I suggest you to create a .ruby-version
file where you set the project's ruby version, in this case 3.1.1我建议您创建一个.ruby-version
文件,您可以在其中设置项目的 ruby 版本,在本例中为 3.1.1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.