安装完ruby之后在命令行使用gem命令安装:
gem install XXX
然后报错
ERROR: Error installing XXX:
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.
在网上找了一些博客之后无果
最后发现
是因为自己ruby的安装路径当中有空格
对没错 就是那个小小的空格 花了我一个多小时
害
小伙伴要是还没有找到解决办法可以重装试试我的解决方法 说不定对你有用
这篇博客讲述了作者在安装Ruby gem时遇到的错误:`Failed to build gem native extension`。问题的根源在于Ruby安装路径中包含空格,这导致了编译失败。经过一个多小时的排查,作者最终发现并解决了这个问题,建议其他遇到同样问题的小伙伴尝试重装Ruby到无空格路径来解决。
50

被折叠的 条评论
为什么被折叠?



