[英]Error installing jekyll: ERROR: Failed to build gem native extension
I use github+jekyll to build blog, i try to install jekyll to local(windows 10), while it failed when i run gem install jekyll
and the stack trace is我使用 github+jekyll 构建博客,我尝试将 jekyll 安装到本地(windows 10),当我运行
gem install jekyll
时失败并且堆栈跟踪是
C:\Developments\FrontEnd\rubygems-2.7.7>gem install jekyll Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser C:/Developments/FrontEnd/Ruby25-x64/bin/ruby.exe -r ./siteconf20180806-33956-l8y76h.rb extconf.rb creating Makefile current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser make "DESTDIR=" clean 'make' is not recognized as an internal or external command, operable program or batch file. current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser make "DESTDIR=" 'make' is not recognized as an internal or external command, operable program or batch file. make failed, exit code 1
what i do is: 1. install ruby, path variable was set, version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
.我要做的是: 1. 安装 ruby,设置路径变量,版本:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
。 2. install rubygems, version: 2.7.7
. 2.安装rubygems,版本:
2.7.7
。 3. install MSYS2. 3.安装MSYS2。 4. install jekyll,
gem install jekyll
, then the above error occurs and i'm not sure the reason. 4. install jekyll,
gem install jekyll
,然后出现上述错误,我不确定原因。
i have tried to install devkit and it not works, i think my ruby version is 2.5+, so don't need devkit and i have uninstalled it.我试图安装 devkit 但它不起作用,我认为我的 ruby 版本是 2.5+,所以不需要 devkit,我已经卸载了它。
Anyone could help me?任何人都可以帮助我吗?
Although they made the Ruby+DevKit an "optional" download for the RubyInstaller on Windows, if you plan to install gems, it is practically a necessity.尽管他们使 Ruby+DevKit 成为 Windows 上 RubyInstaller 的“可选”下载,但如果您打算安装 gems,它实际上是必需的。 A large percentage of the most popular gems are C extension that will need built on your machine when being installed.
大部分最受欢迎的 gem 是 C 扩展,安装时需要在您的机器上构建。
The DevKit is a handy toolchain that supplies everything you need for this to be done, automatically without you needed to do anything more than type gem install XXXXX
. DevKit 是一个方便的工具链,它自动提供完成此操作所需的一切,您无需执行任何操作,只需键入
gem install XXXXX
即可。 Without it, you either cannot use C extension gems, or must have already installed MSYS
and MingW
, have them configured properly, which is all not a user-friendly experience, even for those who familiar with the process.没有它,您要么无法使用 C 扩展 gems,要么必须已经安装了
MSYS
和MingW
并正确配置它们,即使对于那些熟悉该过程的人来说,这也不是一种用户友好的体验。
So even if DevKit is optional, it is still required to make the most of Ruby on Windows.因此,即使 DevKit 是可选的,仍然需要在 Windows 上充分利用 Ruby。
Solution re-install ruby with rubyinstaller-devkit-2.5.5-1-x64解决方案使用 rubyinstaller-devkit-2.5.5-1-x64 重新安装 ruby
and issue并发出
gem install bundler
gem install jekyll
I had the same issue.我遇到过同样的问题。 I was able to resolve it (in Windows 11 x64) via:
我能够通过以下方式解决它(在 Windows 11 x64 中):
winget install -e --id RubyInstallerTeam.RubyWithDevKit
(Ie, reinstall Ruby with the DevKit) (即,使用 DevKit 重新安装 Ruby)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.