[英]trying to run ruby website locally, says "gemfile states ruby version X, but I have version Y", but then says I already installed Y, and version is X
As the titles says: trying to run ruby website locally, says "gemfile states ruby version X, but I have version Y", but then says I already installed Y, and version is X.正如标题所说:试图在本地运行 ruby 网站,说“gemfile 说明 ruby 版本 X,但我有版本 Y”,然后说我已经安装了 Y,版本是 X。
I am not a ruby dev I am just trying to test this site locally and make some some minor edits.我不是 ruby 开发人员,我只是想在本地测试这个站点并进行一些小的编辑。 Thank you.谢谢你。
You have to set the ruby version , when you have multiple versions installed.当您安装了多个版本时,您必须设置 ruby 版本。
version_num - 2.7.2
for your case version_num - 2.7.2
适合您的情况
For rbenv - rbenv local version_num
for current directory, rbenv global version_num
to change globally.对于 rbenv - rbenv local version_num
用于当前目录, rbenv global version_num
用于全局更改。
If you are using rvm you can set it by rvm use version_num
, this will set it only for that particular terminal.如果您使用的是 rvm,您可以通过rvm use version_num
设置它,这将只为该特定终端设置它。 If you want to change the default globally check here https://rvm.io/rubies/default如果要全局更改默认值,请在此处查看https://rvm.io/rubies/default
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.