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:
- Update your
json
gem to1.8.2
version. -- Preferable - Edit
ruby-2.2.1/ext/json/fbuffer/fbuffer.h
file and replace problematic code withVALUE 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
Ruby Hash Default Value Behavior
What's the Difference Between Gem_Home and Gem_Path
How to Validate Exits and Aborts in Rspec
Ruby: File Encryption/Decryption with Private/Public Keys
Implicit Return Values in Ruby
Irb History Not Working with Ruby 2.3.0
Ruby 1.9 + Sinatra Incompatible Character Encodings: Ascii-8Bit and Utf-8
How to Embed Regular Expressions in Other Regular Expressions in Ruby
Docker for MAC - Mkmf.Rb Can't Find Header Files for Ruby
Ruby on Rails Plural (Controller) and Singular (Model) Convention - Explanation
Why Does My Ruby 'Ri' Tool Not Return Results in Command Prompt
Given an Array of Arguments, How to Send Those Arguments to a Particular Function in Ruby
How to Decompress Gzip String in Ruby
How to Ensure That Ruby Uses an Openssl Not Vulnerable to Heartbleed
Openssl::Ssl::Sslerror: Ssl_Connect Returned=1 Errno=0 State=Unknown State: Unknown Protocol
When Would a Ruby Flip-Flop Be Useful