[英]How do I change my ruby version to 2.6.5 using mac os?
我需要将我的 ruby 版本更改为 2.6.5 以获得为现有应用程序运行的开发环境,但是当我尝试安装它时出现奇怪的错误。
Macbook 专业版
M2
文图拉 13.1
ruby-v:3.0.0
节点-v:16.12.0
我安装了 RVM,当我在终端输入切换 ruby 版本时,会发生以下情况:
rvm use 2.6.5
Required ruby-2.6.5 is not installed.
To install do: 'rvm install "ruby-2.6.5"'
接下来我尝试安装 2.6.5
rvm install 2.6.5
ruby-2.6.5 - #removing src/ruby-2.6.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.1/arm64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/placeholder/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/placeholder/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/placeholder/.rvm/log/1671569360_ruby-2.6.5/make.log
There has been an error while running make. Halting the installation.
make.log 文件只是 ruby 试图进行更改的大量代码片段。
关于如何解决这个问题的任何想法?
使用 rvm:
安装ruby版本:
rvm install 2.6.5
设置并使用默认 2.6.5:
rvm use 2.6.5 --default
我最终卸载了 RVM 并切换到 rbenv,在运行这个命令的大量故障排除之后得到了所需的 Ruby 版本 2.6.5 来安装。 因此,对于需要在 ruby 的旧版本上工作的具有 M2 芯片的相同 Macbook pro 的任何其他人,这是我使用的命令。
RUBY_CFLAGS="-w" rbenv install 2.6.5
此外,如果其他人遇到问题并且这对您不起作用,我通过 github 讨论找到了这个答案,还有许多其他解决方法适用于其他各种情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.