无法在 windows11 wsl 上使用 rvm 安装 ruby
问题
我将 Windows 升级到 Windows 11 并在 wsl (ubuntu 18.04 ) 中拥有 ruby on Rails 项目。
我使用 rvm 来管理我的 ruby 版本,
在安装过程中运行后,
rvm install 3.0.0
控制台显示:验证二进制文件
我得到 Windows 蓝屏并显示 STOP: MEMORY_MANAGEMENT
在计算机重新启动之前
我已经完成了
- 我已经运行了内存诊断工具它们没有返回任何问题
- 我尝试重新安装rvm但无法安装任何ruby版本
- 我尝试在同一个rvm上安装其他版本的ruby出现同样的问题
- 我尝试过安装 rbenv 也无法安装 ruby。
我的安装和机器
➜ ~ rvm -v
rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
➜ ~ rvm list
ruby-2.6.0 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
=* ruby-2.7.0 [ x86_64 ]
ruby-3.0.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
➜ ~ rvm use 3.0.0
Using /home/trevorius/.rvm/gems/ruby-3.0.0
ruby: error while loading shared libraries: /home/trevorius/.rvm/rubies/ruby-3.0.0/bin/../lib/libruby.so.3.0: invalid ELF header
Processor : Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2.59 GHz
Ram: 16.0 GB (15.8 GB usable)
System type : 64-bit operating system, x64-based processor
OS: Windows 11 Home
version: 21H2
wsl: Ubunto 18.04
编辑
PS C:\Users\trevo> wsl -l -v
NAME STATE VERSION
* Ubuntu-18.04 Running 1
problem
i upgraded my windows to windows 11 and have ruby on rails projects in the wsl (ubuntu 18.04 ).
i use rvm to manage my ruby versions
after running
rvm install 3.0.0
during install the console displays : verify binary
and i get windows blue screen with STOP: MEMORY_MANAGEMENT
before the computer restarts
I have done
- I have run memory diagnostics tools they return no problems
- I have tried reinstalling rvm but then can't install any ruby versions
- I have tried installing other versions of ruby on the same rvm the same problem occurs
- I have tried installing rbenv and cannot install ruby either.
my installation and machine
➜ ~ rvm -v
rvm 1.29.12 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
➜ ~ rvm list
ruby-2.6.0 [ x86_64 ]
ruby-2.6.5 [ x86_64 ]
=* ruby-2.7.0 [ x86_64 ]
ruby-3.0.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
➜ ~ rvm use 3.0.0
Using /home/trevorius/.rvm/gems/ruby-3.0.0
ruby: error while loading shared libraries: /home/trevorius/.rvm/rubies/ruby-3.0.0/bin/../lib/libruby.so.3.0: invalid ELF header
Processor : Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2.59 GHz
Ram: 16.0 GB (15.8 GB usable)
System type : 64-bit operating system, x64-based processor
OS: Windows 11 Home
version: 21H2
wsl: Ubunto 18.04
edit
PS C:\Users\trevo> wsl -l -v
NAME STATE VERSION
* Ubuntu-18.04 Running 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的解决方案
最终将 wsl 升级到 wsl 2
从 powershell 终端使用
wsl --set-version Ubuntu-18.04 2
我必须删除损坏的 ruby 文件才能使其正常工作,但第一次运行给了我文件的位置。和几个
rm -rf
允许该过程完成。请注意,这是一个相对较长的过程,每次运行大约需要 15 分钟。
在此过程之后,我能够毫无问题地运行 ruby 3.0.0 的安装。
谢谢 NotTheDr01ds 让我找到了解决方案
Solution i used
i ended up upgrading wsl to wsl 2
using
wsl --set-version Ubuntu-18.04 2
from a powershell terminali had to delete the corrupted ruby files for this to work but the first run gave me the location of the files. and a couple of
rm -rf <corrupted folders>
allowed the process to complete.Be warned this is a relatively long process took me approx 15mins per run.
after the process i was able to run the install of ruby 3.0.0 with no problem.
thank you NotTheDr01ds for putting me on track with a solution