How to Install JSON Gem - Failed to Build Gem Native Extension(MAC 10.10)

How to install json gem - Failed to build gem native extension(mac 10.10)

Sad, however, JSON-1.7.7 (and upto 1.8.1) is incompatible with Ruby-2.2.x. As you are using Ruby-2.2.1, it will not work for you.

There are 2 options for you:

  1. Update your json gem to 1.8.2 version. -- Preferable
  2. Edit ruby-2.2.1/ext/json/fbuffer/fbuffer.h file and replace problematic code with VALUE result = rb_str_new(FBUFFER_PTR(fb), FBUFFER_LEN(fb));. Look here for details

gem install json issue with Mac OS X 10.11

I should have used the latest ruby (2.2.3) not the old one (2.2.1)

ruby-rails-sample> rvm --default use 2.2.3
Using /Users/smcho/.rvm/gems/ruby-2.2.3
smcho@macho ruby-rails-sample> gem install json
Building native extensions. This could take a while...
Successfully installed json-1.8.3
Parsing documentation for json-1.8.3
Installing ri documentation for json-1.8.3
Done installing documentation for json after 1 seconds
1 gem installed

How to install json gem - Failed to build gem native extension

I think you need to install one of this packages :

$ apt-file search limits.h | grep 'linux/limits.h'
linux-headers-2.6.32-5-common: /usr/src/linux-headers-2.6.32-5-common/include/linux/limits.h
linux-headers-2.6.32-5-common-openvz: /usr/src/linux-headers-2.6.32-5-common-openvz/include/linux/limits.h
linux-headers-2.6.32-5-common-vserver: /usr/src/linux-headers-2.6.32-5-common-vserver/include/linux/limits.h
linux-headers-2.6.32-5-common-xen: /usr/src/linux-headers-2.6.32-5-common-xen/include/linux/limits.h
linux-libc-dev: /usr/include/linux/limits.h

Can't install json 1.8 gem on Mac OS X 10.8.4

The problem was that my home folder is on a separate volume which contained a space in its name. Because of the space the second part of the name was interpreted as an option. The volumes name was something like My Data and thus I got the messageinvalid option -D.

I just renamed this volume and now everything installs fine.

Native extension error installing JSON gem

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.

An error occurred while installing json (1.8.1) and Bundler cannot continue

Try updating your Gemfile to use json@1.8.2 instead of 1.8.1 - according to this thread Ruby 2.2.x is incompatible with json 1.8.1.

1.8.2 should be functionally similar and not affect any of your other dependencies.

You can also run bundle update json to let bundler try to fix it for you - but that may put you at a much later version than 1.8.2, I'm not sure.

No harm in trying a couple things and reverting your changes.

Trouble installing json gem on mountain lion

I eventually had to go to ruby 1.9.2 in order to make it work.



Related Topics



Leave a reply



Submit