如何在同一台机器上使用两个Ruby,Rails版本,但是不同的项目?
现在,我在桌面上有一个带有版本的
项目demo
Ruby-2.6.3p62
Rails-4.2.11.3
Gem-3.0.3
,我想在我的台式机上创建另一个
project new
代码>使用版本
ruby-3.1.1p18
Rails-7.0.2.3
Gem-3.3.13
,目前,我拥有此rbenv
版本,
rbenv version
2.6.3 (set by /home/akshit/.rbenv/version)
您可以共享有关如何创建项目new
而不会影响我的project> project project demo
的命令吗?
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
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用RBENV执行此操作:
项目新
rbenv install 3.1.1
,然后rbenv local 3.1.1
该项目将使用指定的版本,我建议您创建一个
.ruby-version
在其中设置项目的Ruby版本,在这种情况下为3.1.1Using rbenv do this:
project new
rbenv install 3.1.1
and thenrbenv local 3.1.1
so for this project it will use the specified versionI suggest you to create a
.ruby-version
file where you set the project's ruby version, in this case 3.1.1