oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
644 stars 248 forks source link

Windows 10: Error installing Jekyll #355

Closed TheVietScholar closed 9 months ago

TheVietScholar commented 10 months ago

What problems are you experiencing?

Jekyll is failing to install

Steps to reproduce

gem install jekyll bundler

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

    current directory: C:/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/gems/ffi-1.15.5/ext/ffi_c
C:/Ruby32-x64/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... no
checking for whether -Wl,--exclude-libs,ALL is accepted as LDFLAGS... yes
checking for whether -pthread is accepted as LDFLAGS... yes
creating extconf.h
creating Makefile

current directory: C:/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/gems/ffi-1.15.5/ext/ffi_c
make DESTDIR\= sitearchdir\=./.gem.20230831-15532-q4tnks sitelibdir\=./.gem.20230831-15532-q4tnks clean

current directory: C:/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/gems/ffi-1.15.5/ext/ffi_c
make DESTDIR\= sitearchdir\=./.gem.20230831-15532-q4tnks sitelibdir\=./.gem.20230831-15532-q4tnks
generating ffi_c-x64-mingw-ucrt.def
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `mkdir -p "/c/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/gems/ffi-1.15.5/ext/ffi_c/libffi-x64-mingw-ucrt" ""/c/Users/Matthew(D)"'
make: *** [libffi.mk:6: "/c/Users/Matthew] Error 2

make failed, exit code 2

Gem files will remain installed in C:/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/gems/ffi-1.15.5 for inspection.
Results logged to C:/Users/Matthew Nguyen/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/ffi-1.15.5/gem_make.out
Fetching bundler-2.4.19.gem
Successfully installed bundler-2.4.19
Parsing documentation for bundler-2.4.19
Installing ri documentation for bundler-2.4.19
Done installing documentation for bundler after 0 seconds
1 gem installed

What's the output from ridk version?

ruby:
  path: C:/Ruby32-x64
  version: 3.2.2
  platform: x64-mingw-ucrt
ruby_installer:
  package_version: 3.2.2-1
  git_commit: 83df213
msys2:
  path: C:\Ruby32-x64\msys64
cc: gcc (Rev10, Built by MSYS2 project) 12.2.0
sh: GNU bash, version 5.2.15(1)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 10.0.19045.3324]
Largo commented 10 months ago

Hi! I think it fails because your Windows username and user folder has a space in it. I might be wrong, but if it is this, then I'm not sure if this project can fix this problem, but maybe we can let the other project know.

Can you rename the user folder?

TheVietScholar commented 10 months ago

I looked to see if I could, and while it's possible, I didn't want to risk my system and change the name of the user folder. Also, I was able to install Jekyll on another Windows system I had where the User folder had a space, so I don't believe that to be the issue.

MSP-Greg commented 10 months ago

Can you install ffi by itself? gem install ffi?

Or, try something like gem install --install-dir=C:/gem_install_temp ffi

Lastly, ffi has a precompiled gem available, but it only supports Ruby 3.1 and earlier. What Ruby version did the other system use?

TheVietScholar commented 9 months ago

Hello,

The first command gives a similar error as when I tried to run gem install jekyll bundler but the second one succeeds.

The other Windows system has ruby 3.2.2 (2023-03-30).

MSP-Greg commented 9 months ago

@TheVietScholar

Thanks for checking. If the second command worked, that might indicate that Ruby's mkmf (which is used by most gems that require compiling) is having an issue with spaces in build paths. Not.sure. I'll see if I can try it locally. Unfortunately, most cloud CI that I'm aware of tests with build paths that do not contain a space...

mohits commented 9 months ago

356 had the same problem on Windows 11 and it was resolved by installing Ruby to a path without spaces - probably a workaround but it really helps if Ruby could be installed to a path without a space.