繁体   English   中英

gem 错误:无法构建 gem 原生扩展

[英]gem error: Failed to build gem native extension

删除所有本地 gem 后尝试重新安装 rails 出现以下错误:

Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/site_ruby/3.0.0 -r ./siteconf20220903-5400-zth3ct.rb extconf.rb
creating Makefile

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\= clean
current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5/ext/websocket-driver
make DESTDIR\=
make failedNo such file or directory - make

Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.5 for inspection.
Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/websocket-driver-0.7.5/gem_make.out 

最近我更换了我的主板,但它仍然是同一个SSD,以前这个问题从未发生过,Ruby 运行正常;

我已经尝试重新安装 MinGW,我可以尝试其他选项吗?

提前致谢

你已经安装了系统 ruby 所以你必须卸载它,然后以普通用户身份安装 rvm 并使用 rvm 安装 ruby 一定要使用相同的 ruby 版本,请参阅你的 Gemfile 或你的 Gemfile 中提到的版本。删除 Gemfile.lock 和 .ruby-version,尤其是 .ruby-version,因为这会在版本更改之前持续存在错误,直到您将其删除

具体的错误原因包含在您发布的消息中,它只是在上下文中隐藏了一点:

制作失败没有这样的文件或目录 - 制作

您的系统似乎没有安装make lib。 通过安装整个 MSYS2 和 MINGW 开发工具链解决了类似的问题:

ridk install

然后选项:

[1,3]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM