[ruby] The 'json' native gem requires installed build tools

I have ruby 1.9.2p180 (2011-02-18) [i386-mingw32] installed on my windows 7 machine. Now I tried to install the JSON gem using the command, "gem install json" and got the following error.

ERROR:  Error installing JSON:
    The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from '[http://rubyinstaller.org/downloads][1]' and follow the instructions
at '[http://github.com/oneclick/rubyinstaller/wiki/Development-Kit][2]'

Then I went and downloaded DevKit-4.5.0-20100819-1536-sfx.exe. Extracted it to C:\DevKit. And then from the command prompt, I executed the following commands.

ruby dk.rb init

After the above command is executed, I verified that config.yaml is generated and it has the path for my ruby folder added automatically. This is the line at the bottom of the config.yaml file "- C:/Ruby192"

ruby dk.rb review

I got the message that devkit functionality will be injected into the rubies when you run "ruby dk.rb install"

ruby dk.rb install

I got the following message.

[INFO] RubyGems override already in place for C:/Ruby192, skipping.
[INFO] Installing C:/Ruby192/lib/ruby/site_ruby/devkit.rb

Now I tried executing the JSON gem again using the command gem install json. Then got the same error message as before.

ERROR:  Error installing JSON:
    The 'json' native gem requires installed build tools.........

Am I missing something?

This question is related to ruby json windows-7 rubygems

The answer is


I would like to add that you should make sure that the generated config.yml file when doing ruby dk.rb init contains the path to the ruby installation you want to use DevKit with. In my case, I had the Heroku Toolbelt installed on my system, which provided its own ruby installation, located at a different place. The config.yml file used that particular installation, and that's not what I wanted. I had to manually edit the file to point it to the correct one, then continue with ruby dk.rb review, etc.


My gem version 2.0.3 and I was getting the same issue. This command resolved it:

gem install json --platform=ruby --verbose

Follow the Instructions from the Ruby Installer Developer Kit Wiki:

  1. Download Ruby 1.9.3 from rubyinstaller.org
  2. Download DevKit file from rubyinstaller.org
  3. Extract DevKit to path C:\Ruby193\DevKit
  4. Run cd C:\Ruby193\DevKit
  5. Run ruby dk.rb init
  6. Run ruby dk.rb review
  7. Run ruby dk.rb install

To return to the problem at hand, you should be able to install JSON (or otherwise test that your DevKit successfully installed) by running the following commands which will perform an install of the JSON gem and then use it:

gem install json --platform=ruby
ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect"

Followed the steps.

  1. Extract DevKit to path C:\Ruby193\DevKit
  2. cd C:\Ruby192\DevKit
  3. ruby dk.rb init
  4. ruby dk.rb review
  5. ruby dk.rb install

Then I wrote the command

gem install rails -r -y

My solution is simplier and checked on Ruby 2.0. It also enable download Json. (run CMD.exe as administrator)

    C:\RubyDev>devkitvars.bat
    Adding the DevKit to PATH...

And then write again gem command.


1) Download Ruby 1.9.3

2) cmd check command: ruby -v 'return result ruby 1.9.3 then success full install ruby

3) Download DevKit file from http://rubyinstaller.org/downloads (DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe)

4) Extract DevKit to path C:\Ruby193\DevKit

5) cd C:\Ruby193\DevKit

6) ruby dk.rb init

7) ruby dk.rb review

8) ruby dk.rb install

9) cmd : gem install rails -v3.1.1 'few time installing full process'

10) cmd : rails -v 'return result rails 3.1.1 then its success fully install'

enjoy Ruby on Rails...


I have found that the error is sometimes caused by a missing library.

so If you install RDOC first by running

gem install rdoc

then install rails with:

gem install rails

then go back and install the devtools as mentioned before with:

1) Extract DevKit to path C:\Ruby193\DevKit
2) cd C:\Ruby192\DevKit
3) ruby dk.rb init
4) ruby dk.rb review
5) ruby dk.rb install

then try installing json

which culminate with you finally being able to run

rails new project_name - without errors.

good luck


Examples related to ruby

Uninitialized Constant MessagesController Embed ruby within URL : Middleman Blog Titlecase all entries into a form_for text field Ruby - ignore "exit" in code Empty brackets '[]' appearing when using .where find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException) How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite? How to fix "Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5" while server starting Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? How to update Ruby with Homebrew?

Examples related to json

Use NSInteger as array index Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) HTTP POST with Json on Body - Flutter/Dart Importing json file in TypeScript json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190) Angular 5 Service to read local .json file How to import JSON File into a TypeScript file? Use Async/Await with Axios in React.js Uncaught SyntaxError: Unexpected token u in JSON at position 0 how to remove json object key and value.?

Examples related to windows-7

ng is not recognized as an internal or external command Why am I getting ImportError: No module named pip ' right after installing pip? How to Delete node_modules - Deep Nested Folder in Windows Telnet is not recognized as internal or external command Multiple -and -or in PowerShell Where-Object statement How do I set ANDROID_SDK_HOME environment variable? Run Batch File On Start-up Why isn't .ico file defined when setting window's icon? How to access shared folder without giving username and password Can't start hostednetwork

Examples related to rubygems

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException) How to fix "Your Ruby version is 2.3.0, but your Gemfile specified 2.2.5" while server starting You don't have write permissions for the /var/lib/gems/2.3.0 directory Can't install gems on OS X "El Capitan" How to avoid "cannot load such file -- utils/popen" from homebrew on OSX How can I set a proxy server for gem? How to install CocoaPods? Error while installing json gem 'mkmf.rb can't find header files for ruby' How to downgrade or install an older version of Cocoapods