简体   繁体   English

构建 gem 原生扩展失败?

[英]Failed to build gem native extension?

I have recently tried to install rails via gem by running gem install rails .我最近尝试通过运行gem install rails However, it always fails with the following error message.但是,它总是失败并显示以下错误消息。

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: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
D:/Program\ Files/Ruby30-x64/bin/ruby.exe -I D:/Program\ Files/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20210303-3696-skc9xl.rb extconf.rb
creating Makefile

current directory: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
make "DESTDIR=" clean
Makefile:269: *** multiple target patterns.  Stop.

current directory: D:/Program Files/Ruby30-x64/lib/ruby/gems/3.0.0/gems/websocket-driver-0.7.3/ext/websocket-driver
make "DESTDIR="
Makefile:269: *** multiple target patterns.  Stop.

make failed, exit code 2

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

Does anyone know what is actually happening here?有谁知道这里实际发生了什么? I would appreciate any answer.我会很感激任何答案。 Thanks谢谢

Usually, this "multiple target patterns" error when compile gem extensions is caused by spaces in directory names where you have installed your Ruby or your gems.通常,编译 gem 扩展时出现的“多目标模式”错误是由安装 Ruby 或 gem 的目录名称中的空格引起的。

Especially on Windows, you should install your Ruby to a directory which contains no spaces, rather than your current location D:/Program Files/Ruby30-x64 .特别是在 Windows 上,您应该将 Ruby 安装到不包含空格的目录,而不是当前位置D:/Program Files/Ruby30-x64 To fix this, I recommend to uninstall Ruby and install it again to a more appropriate location.要解决此问题,我建议卸载 Ruby 并再次将其安装到更合适的位置。

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

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