5

Here is the error I keep getting. I installed DevKit and followed all the instructions.

gem install json -v '1.6.3'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

        "C:/Program Files/Ruby/Ruby192/bin/ruby.exe" extconf.rb
creating Makefile

make
Makefile:160: warning: overriding commands for target `C:/Program'
Makefile:153: warning: ignoring old commands for target `C:/Program'
C:/Program Files/Ruby/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_parser'"  > par
ser-i386-mingw32.def
/bin/sh: C:/Program: No such file or directory
make: *** [parser-i386-mingw32.def] Error 127


Gem files will remain installed in C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3 for inspection.
Results logged to C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out

Does anyone have a solution to this?

Sahil
  • 153
  • 3
  • 12

1 Answers1

10

Just ran into this as well. Via Installing dm-types on Windows. (Win7 x64): this fixed it:


It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:

mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"

and then try installing with c:\ruby\bin\ruby.exe. You can delete the symlink after installing.

Community
  • 1
  • 1
Seabass
  • 1,963
  • 12
  • 15
  • This got me pointed in the right direction, I also backed up my PATH and added this new c:\ruby\bin to it, so 'gem install whatever' would work, after getting everything installed I restored my path and we were good to go! – Xedecimal Oct 24 '12 at 14:55
  • Works like charm. Thank you, Sebastian. I would also suggest to change the Ruby entry in system Path environment variable to point the `c:\ruby` directory to avoid these kind of problems in the future. – Janusz Lenar Nov 12 '12 at 22:32