'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 rungem install jekyll and the stack trace is

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]. 2. install rubygems, version: 2.7.7. 3. install MSYS2. 4. install jekyll, gem install jekyll, then the above error occurs and i'm not sure the reason.

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.

Anyone could help me?



Solution 1:[1]

Solution re-install ruby with rubyinstaller-devkit-2.5.5-1-x64

and issue

gem install bundler

gem install jekyll

Solution 2:[2]

I got the same error message. It turned out that the culprit was the ffi gem. I got it to work using this solution.

Solution 3:[3]

I had the same issue. I was able to resolve it (in Windows 11 x64) via:

winget install -e --id RubyInstallerTeam.RubyWithDevKit

(I.e., reinstall Ruby with the DevKit)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Rao
Solution 2 Roald
Solution 3 Jeremy Caney