While installaing json gem in Ruby on Rails 3.0 or 3.1, I was getting following error,
$ gem install json -v=1.4.6 –platform=ruby –no-ri –no-rdoc
Fetching: json-1.4.6.gem (100%)
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’ and follow the instructions
To fix this problem, need to install Development Kit (DevKit – Its a toolkit that makes it easy to build and use native C/C++ extensions for Ruby on Windows) as follows,
1) Download DevKit file from http://rubyinstaller.org/downloads (DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe)
2) Extract DevKit to path C:\Ruby192\DevKit
3) Goto DevKit installation directory,
4) Run following command,
ruby dk.rb init
It will generate the config.yml file. This config file should include installed Ruby path, like “C:\Ruby192”
5) Run following command,
ruby dk.rb review
It is useful to review the list of Rubies to be enhanced to use the DevKit and verify the changes you made to it are correct.
6) Run following command,
ruby dk.rb install
It is useful to enhance your installed Rubies and makes it easy to build and use native C/C++ extensions such as json.