Technology Insights

Install Ruby JSON Gem on Windows

When attempting to install the Ruby JSON gem on Windows you are most likely going to get an error similar to the below. The trick is to instead install json_pure gem using the syntax listed below the error.



  1. C:\>gem install json
  2. Building native extensions. This could take a while...
  3. ERROR: Error installing json:
  4. ERROR: Failed to build gem native extension.
  6. C:/ruby/bin/ruby.exe extconf.rb install json
  7. creating Makefile
  9. nmake
  10. 'nmake' is not recognized as an internal or external command, operable program or batch file.
  12. Gem files will remain installed in C:/ruby/lib/ruby/gems/1.8/gems/json-1.1.3 for inspection.
  13. Results logged to C:/ruby/lib/ruby/gems/1.8/gems/json-1.1.3/ext/json/ext/parser/gem_make.out

Technology Errors

‘nmake’ is not recognized as an internal or external command, operable program or batch file

This means nmake is not installed on your Windows PC. To install you need to downloading, extract, and place two files into your $PATH. Follow the couple steps below to install nmake on your PC. In my case I installed nmake on Windows XP.

  1. Download nmake: Visit the following link to download nmake.
  2. Extract nmake:Run the Nmake15.exe file which will extract two files to the directory where it is located. These files will be nmake.exe and NMAKE.ERR.

Technology Errors

ruby.exe: No such file or directory — /cygdrive/c/ruby/bin/gem (LoadError)

When attempting to install a gem using cygwin on a Windows XP machine I received the below error. I was hoping I wasn’t going to have to reinstall RubyGems underneath cygwin because it would have just been a pain. I had Ruby installed and operational underneath cygwin but for some reason rubygems was not working. I decided to instead make an alias to point to the gem command that I had installed straight to Windows. Use the below command to add an alias to cygwin to make gem an available command.

Error: ruby.exe: No such file or directory — /cygdrive/c/ruby/bin/gem (LoadError)

To resolve use the below command from your cygwin bash prompt to create an alias for gem. On my laptop Ruby is installed in C:\ruby so the commands are located in C:\ruby\bin.