0

[System : Windows 10] (pro, up to date)

Hi folks, I’m new here and I know I have a question asked many times, but… I don’t understand the answers, frankly, and I’m fairly lost… English is not my native language, sorry if it shows.

What I want to do:

I want to install Jekyll for a personal blog. I have an issue at the end of the installation : Error installing jekyll: ERROR: Failed to build gem native extension

What I already did:

  • Following the instructions here, I have installed Ruby+Devkit 3.1.1-1 (x64) , with the ridk install crossed at the end of the install.
  • The ridk install open a command window, I have installed the 3 things asked and it seems to have succeeded.
  • I installed gcc with mingw-get-setup.exe for the dependancies (if I’m not mistaken, maybe it wasn’t necessary).
  • Run in git bash gem install bundler (with or without admin right, seems to do the same). Success.
  • Run in git bash gem install jekyll - fail. (even after a relaunch of the computer).
  • I have seen an answer in another thread who was telling to do a gem update before installing Jekyll - failed.

So I guess the problem is more on this end, here are the logs :
First part:

ERROR:  Error installing bigdecimal:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bigdecimal-3.1.2/ext/bigdecimal
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220322-6432-916opp.rb extconf.rb
checking RUBY_BIGDECIMAL_VERSION... 3.1.2
checking for __builtin_clz()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

the mkmf.log file :

PATH=".;C:/Ruby31-x64/lib;C:\Ruby31-x64\bin;C:\Ruby31-x64\msys64\mingw64\bin;C:\Ruby31-x64\msys64\usr\bin;C:\Users\User\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\User\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Ruby31-x64\bin;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\atom\bin;C:\Users\User\AppData\Local\GitHubDesktop\bin;C:\Users\User\AppData\Roaming\npm;C:\MinGW\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl" "gcc -o conftest.exe -IC:/Ruby31-x64/include/ruby-3.1.0/x64-mingw-ucrt -IC:/Ruby31-x64/include/ruby-3.1.0/ruby/backward -IC:/Ruby31-x64/include/ruby-3.1.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong conftest.c  -L. -LC:/Ruby31-x64/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed  -m64   -lx64-ucrt-ruby310  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt  "
conftest.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
 #include "ruby.h"
 
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

2nd part:

C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
To see why this extension failed to compile, please check the mkmf.log which can be found here: //(same mkmf.log)

extconf failed, exit code 1


So, I get in the 2nd part that the development tools need to be installed… There is this thread who try to answer this question, but wasn’t Ruby+Devkit handling this part ? Did I miss something ?

I have seen other answers telling to add the devkit in the path, but I don’t have any RubyDevkit folder in my computer… I’m lost .

Thanks in advance for any answer, hope I did not forget anything ^^’

Yazae
  • 11
  • 3
  • Try one of these suggestions to solve the issue: https://stackoverflow.com/q/27768420/895789 – Christian Mar 22 '22 at 22:28
  • Hi, most of these suggestions are for mac or linux, the one for windows say to install the ruby dev tools… wich should already be installed. Maybe the problem comes with the compiler ? I found this answer https://stackoverflow.com/questions/11480430/how-to-compile-a-ruby-c-extension-and-link-libcurl-on-windows/11484346#11484346. if Gcc is for 32bits, does that may cause problems with Ruby 64 bits ? I’m very new to this kind of things but `gcc -v` says it’s for Win32. – Yazae Mar 23 '22 at 08:50

2 Answers2

1

Ok I think I found my answer : the problem was that I was using the command prompt of git bash. I tried commande prompt with ruby and the installation seems to work fine.

So, I don’t understand where is the issue with git bash, but I’m done for now since it seems to work fine.

Thanks for the help !

Yazae
  • 11
  • 3
0

I didn't succeed to reproduce your issue everything works for me ^^'. Can you open a Command Prompt and past the output of the following command:

ridk install

?

Rollniak
  • 1
  • 1
  • Hi, thanks for your answer ! I get this : `bash : ridk install : command not found` Is it not normal ? The only ridk install I did was by crossing the dot in the `Ruby+Devkit 3.1.1-1 (x64)`. – Yazae Mar 23 '22 at 08:27
  • You can use this in the question's comment section – Anand Mar 23 '22 at 12:15