Ruby 2.4.10安装Rails依赖及MSYS2开发工具时报错该如何解决?
解决Ruby 2.4.10安装Rails依赖时的MSYS2相关错误
遇到的问题及背景
- 安装Rails项目gems时出现大量
make/Makefile相关错误,根源是开发工具未正确安装。 - Ruby Installer with DevKit自带的MSYS2版本存在缺陷,安装部分gems时触发404错误:
error: failed retrieving file 'mingw-w64-x86_64-binutils-2.30-5-any.pkg.tar.xz' from repo.msys2.org : The requested URL returned error: 404 - 为解决上述问题,安装了最新版MSYS2,并重新安装不带MSYS2的Ruby 2.4.10(因不清楚如何修改Ruby Installer中MSYS的默认路径)。
- 运行
ridk install并选择选项3时,出现新错误:error: target not found: automake1.10
解决方法
问题出在Ruby Installer默认执行的pacman命令中包含了已从MSYS2仓库移除的老旧包,只需移除这些不存在的包即可修复。
Ruby Installer 2.4.10 with DevKit默认执行的命令
pacman -S --needed --noconfirm autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 diffutils file gawk grep libtool m4 make patch pkg-config sed texinfo texinfo-tex wget mingw-w64-x86_64-binutils mingw-w64-x86_64-crt-git mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-headers-git mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-tools-git mingw-w64-x86_64-winpthreads-git
修复后的执行命令
移除了automake1.10、automake1.6、automake1.7、automake1.8、automake1.9这些已废弃的包,执行以下命令:
ridk exec pacman -S --needed --noconfirm autoconf autoconf2.13 autogen automake-wrapper automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 diffutils file gawk grep libtool m4 make patch pkg-config sed texinfo texinfo-tex wget mingw-w64-x86_64-binutils mingw-w64-x86_64-crt-git mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-headers-git mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-tools-git mingw-w64-x86_64-winpthreads-git
内容的提问来源于stack exchange,提问作者JRotko
相关产品推荐
相关产品推荐

