4

I've set up the Brightbox Ruby 2.1.0 apt package and encountering a native compilation error installing json package.

$ sudo gem install json -v '1.8.1'

Fetching: json-1.8.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

I've installed ruby2.0-dev as mentioned here, but it puts the headers in a different folder (/usr/include/ruby-2.0.0/ruby, and copying them to /usr/lib/ruby/include didn't help). Any idea how to install this gem?

mahemoff
  • 44,526
  • 36
  • 160
  • 222

1 Answers1

5

I imagine you'll need to install the ruby2.1-dev package, rather than ruby2.0-dev, if you're using Ruby 2.1. I've not used the Brightbox packages though, so I'm only guessing I'm afraid.

Jam
  • 66
  • 2
  • Doesn't exist unfortunately – mahemoff Feb 21 '14 at 23:42
  • @Jam This would be more appropriate for a comment vs an answer. – Popo Feb 22 '14 at 00:01
  • Actually I looked at this again and it does exist, and fixes the issues. Almost sure I tried it before and got an error (maybe it was on a machine lacking the brightbox repo config). Anyway it's working now. – mahemoff Feb 22 '14 at 11:05