12

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?

7
  • 1. You still need devkit for Ruby 2.5+ to install C extension gems (doubtful you have set up MSYS and MingW independently of Ruby based on this question. Unsure why you would feel it is not needed for 2.5+ 2. RubyGems is already packaged with Ruby, you don't need to install it. Commented Aug 6, 2018 at 3:53
  • @ForeverZer0 helpful, I re-install Ruby with DevKit, now it works, jekyll could installed.
    – Rollsbean
    Commented Aug 6, 2018 at 6:45
  • They did make separate downloads for the Windows installer that do not include DevKit, but is practically a necessity. It is quite necessary to be able to use a large percentage extremely popular gems. Commented Aug 6, 2018 at 7:05
  • @ForeverZer0 could you add this answer not in comments, then i can accept your answer.
    – Rollsbean
    Commented Aug 6, 2018 at 7:12
  • No problem, I made a post for ya :) Commented Aug 6, 2018 at 7:33

4 Answers 4

10

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. A large percentage of the most popular gems are C extension that will need built on your machine when being installed.

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. 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.

So even if DevKit is optional, it is still required to make the most of Ruby on Windows.

4

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

and issue

gem install bundler

gem install jekyll
3

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

0

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)

Not the answer you're looking for? Browse other questions tagged or ask your own question.