ERROR: Error installing json: ERROR: Failed to build gem native extension
For anyone who has this issue on Sierra, I solved the problem through this thread: https://teamtreehouse.com/community/installing-ruby-on-mac-got-error
Coles notes version is that after updating to most recent version of XCode, I had to accept the terms for the XCode command line tools. See them/agree to them by running:
gcc --version
After I did that, everything installed as expected.
To help you here are some steps to follow in order to install your gem locally:
- Download json-1.8.3.
- Place the downloaded gem into a folder called
gems
- Open the Ruby
cmd
console (click on start button, select Ruby then select "Start command prompt with Ruby") cd
to the gems folder. If the path to the folder isC:\Desktop\gems
, write the command:cd C:\Desktop\gems
then click "Enter".To install the gem run the following command:
gem install --local json-1.8.3.gem
I tried it and it worked for me, hopefully it will work for you.
Result:
Second way:
Include the whole path of the gem in the command:
gem install --local C:\Users\kedarl\Desktop\T\json-1.8.2.gem
For me here is the result. (This time with the json-1.8.2.gem):