如何在同一台机器上使用两个Ruby,Rails版本,但是不同的项目?

发布于 2025-01-26 17:36:05 字数 475 浏览 4 评论 0原文

现在,我在桌面上有一个带有版本的项目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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗地喜欢 2025-02-02 17:36:05

使用RBENV执行此操作:

  • 创建项目新
  • 在根文件夹内部打开一个终端
  • witr rbenv install 3.1.1,然后rbenv local 3.1.1该项目将使用指定的版本,

我建议您创建一个.ruby-version在其中设置项目的Ruby版本,在这种情况下为3.1.1

Using rbenv do this:

  • create project new
  • open a terminal inside root folder
  • write rbenv install 3.1.1 and then rbenv local 3.1.1 so 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文