I tried to install JSON for Ruby via RubyGem,
# gem install json
and I got the following error message:
Building native extensions. This could take a while...<br /> ERROR: Error installing json:<br /> ERROR: Failed to build gem native extension.
<br /> /usr/bin/ruby1.8 extconf.rb install json<br /> extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)<br /> from extconf.rb:1<br />
<br /> Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.1.6 for inspection.<br /> Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.1.6/ext/json/ext/generator/gem_make.out<br />
However, I found out in Debian, we can just install this library libjson-ruby:
<br /> $ sudo apt-get install libjson-ruby<br />
Now, try to verify if it works:
<br /> $ irb<br /> irb(main):001:0> require 'json'<br /> => true<br /> irb(main):002:0>