sridhar249 sridhar249 - 1 year ago 145
JSON Question

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 '[][1]' and follow the instructions
at '[][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 functionaliy 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.

Answer Source

I believe those installers make changes to the path. Did you try closing and re-opening the CMD window after running them and before the last attempt to install the gem that wants devkit present?

Also, be sure you are using the right devkit installer for your version of Ruby. The documentation at devkit wiki page has a requirements note saying:

For RubyInstaller versions 1.8.7, 1.9.2, and 1.9.3 use the DevKit 4.5.2

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download