0
votes

I've tried installing using as part of the bundle and using sudo, but I get the same error message every time. I'm currently on Ruby 2.0.0 and Rails 4.1.8. I'm not sure what is going on. The exact error message below:

Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.4.2 Using i18n 0.6.11

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20141218-80226-brqexc.rb extconf.rb mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out An error occurred while installing json (1.8.1), and Bundler cannot continue. Make sure that gem install json -v '1.8.1' succeeds before bundling.

Any advice appreciated.

1
I've run into similar issues after upgrading to Yosemite. gcc version was the root of all of them. brew rm gcc46, brew install libxml2 and then brew install libxslt helped me. I did a lot of brew doctor in the process.eebbesen
xcode and command tools installation may help as well.eebbesen
I too ran into this issue after upgrading to Yosemite. If you have xcode and command tools installed, you have to open xcode and agree to their terms before command line tools function properly.Aman Alshurafa
How do I make sure command line is installed? I did xcode-select --install but there was no GUI pop-up, only an outline of usage. I am unable to properly install Homebrew because of this issue, so I can't yet use brew doctor.cat

1 Answers

0
votes

I've run into similar error on Ubuntu and all I needed to do was:

sudo apt-get install ruby-dev

For Mac, the following gist seems worth to have a look into: Setup mac for ruby dev