Upgrade mac OS Mavericks to the latest version. Json loading error:
Copy codeThe Code is as follows:
Gem install json-v '1. 8.1'
Building native extensions. This cocould take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Usr/local/var/rbenv/versions/2.0.0-p247/bin/ruby extconf. rb
Creating Makefile
Make "DESTDIR ="
Compiling generator. c
In file encoded ded from/usr/local/var/rbenv/versions/2.0.0-p247/include/ruby-2.0.0/ruby. h: 33,
From ../fbuffer. h: 5,
From generator. c: 1:
/Usr/local/var/rbenv/versions/2.0.0-p247/include/ruby-2.0.0/ruby. h: 51: 21: error: string. h: No such file or directory
/Usr/local/var/rbenv/versions/2.0.0-p247/include/ruby-2.0.0/ruby. h: 61: 21: error: stdint. h: No such file or directory
/Usr/local/var/rbenv/versions/2.0.0-p247/include/ruby-2.0.0/ruby. h: 64: 23: error: inttypes. h: No such file or directory
/Usr/local/var/rbenv/versions/2.0.0-p247/include/ruby-2.0.0/ruby. h: 68: 19: error: stdio. h: No such file or directory
Solution:
Copy codeThe Code is as follows: xcode-select -- install
Command Line Developer Tools needs to be re-installed
If this method still does not work, mac needs to install the apple-gcc42
Copy codeThe Code is as follows: brew install apple-gcc42
Note that brew 0.9.4 should be the source without a apple-gcc42, you can use brew doctor to check whether it is compatible with Mavericks, here you need to upgrade
Copy codeThe Code is as follows: brew update