0

I have experienced this a few times trying to install different gems using 32 bit ruby, this time I upgraded to Ruby 3.1.2 in hopes it would be resolved

Specifically it appears that either gem maintainers, or the maintainer of MSYS/MINGW dont wrap the Program Files path in quotes, so the space in the folder name seems to be crashing the script.

Would be grateful for any solutions

PS C:\Users\alilland\Documents\dev\scheduler2.0> gem install bson -v 4.12.1
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing bson:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby31/lib/ruby/gems/3.1.0/gems/bson-4.12.1/ext/bson
C:/Ruby31/bin/ruby.exe -I C:/Ruby31/lib/ruby/site_ruby/3.1.0 extconf.rb
creating Makefile

current directory: C:/Ruby31/lib/ruby/gems/3.1.0/gems/bson-4.12.1/ext/bson
C:Program Files \(x86\)GnuWin32binmake.exe DESTDIR\= sitearchdir\=./.gem.20221013-364-mygij2 sitelibdir\=./.gem.20221013-364-mygij2 clean
current directory: C:/Ruby31/lib/ruby/gems/3.1.0/gems/bson-4.12.1/ext/bson
C:Program Files \(x86\)GnuWin32binmake.exe DESTDIR\= sitearchdir\=./.gem.20221013-364-mygij2 sitelibdir\=./.gem.20221013-364-mygij2
make failedNo such file or directory - C:Program

Gem files will remain installed in C:/Ruby31/lib/ruby/gems/3.1.0/gems/bson-4.12.1 for inspection.
Results logged to C:/Ruby31/lib/ruby/gems/3.1.0/extensions/x86-mingw32/3.1.0/bson-4.12.1/gem_make.out

Edit:

after looking to implement the solution mentioned below (moving the GnuWin32binmake.exe file to a different path) I discovered that its actually an entire folder path thats crammed into a string, its supposed to be a filepath C:\Program Files (x86)\GnuWin32\bin\make.exe

Also mongodb the (the bson gem maintainer) provides no way for the public to report bugs, having disabled bug reporting on github, and their online issue tracker for Jira does not allow the general public access.

alilland
  • 2,039
  • 1
  • 21
  • 42
  • As you can see from the error message, the script which is running here is not properly quoting the path to the make program. You could report this to the maintainer of the gem. As a quick workaround, you could reinstall `GnuWin32binmake.exe` into a directory which does not contain a space in its name. – user1934428 Oct 14 '22 at 06:57
  • @user1934428 thats a second problem then because the installer doesnt let you define where the `GnuWin32binmake.exe` file can go, the ruby installation is already installed at the root of the `C:` drive – alilland Oct 14 '22 at 16:30
  • In this case, I would repost the whole question, including all the details about the installation location, to [su], because it is definitely not a problem about programming anymore. BTW, I'm pretty sure that you can install the whole thing anywhere you like (including, for instance, an USB drive). Perhaps it is relocatable (i.e. you can copy it to where you want, and just adjust your PATH accordingly). This too can be answered on either [su], or on the site you have downloaded everything from. – user1934428 Oct 16 '22 at 07:16
  • BTW, from https://gnuwin32.sourceforge.net/packages/make.htm, I would guess that if you don't use the installer, but install it manually from the zip-file, you can choose the location where it should go. – user1934428 Oct 16 '22 at 07:23
  • i just handed off my computer to my IT guys friday to reinstall windows, i installed ruby 3.1.2 successfully on two other machines who had never had ruby installed, so im just chalking up to something is left behind from previous installs – alilland Oct 17 '22 at 01:33

0 Answers0