Debian JSON for Ruby

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...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install json
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.1.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.1.6/ext/json/ext/generator/gem_make.out

However, I found out in Debian, we can just install this library libjson-ruby:

$ sudo apt-get install libjson-ruby

Now, try to verify if it works:

$ irb
irb(main):001:0> require 'json'
=> true


2 thoughts on “Debian JSON for Ruby

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s