OS: Mac OS X 10.10.3 XCode: Latest with command line tools installed (version 6.3) Rails: version 4.2.1 Ruby: version 2.2.1
I was trying to generate the rou
If you are using Ruby 2.2.0 or greater, the json gem will not compile properly. You can fix this by issuing bundle update json
This worked for me, since I downloaded basic Ruby by accident.
Install the Ruby "Development Kit" here: http://rubyinstaller.org/downloads/ Click the self-extracting file, and extract it here:
(or somewhere else, but I had problems in other directories)
Open the cmd (terminal):
cd C:\RubyDevKit
ruby dk.rb init
ruby dk.rb install
Source: http://jekyll-windows.juthilo.com/1-ruby-and-devkit/
I encountered this problem as well, and none of the suggested fixes here solved it.
I was only able to resolve it by manually re-downloading and re-installing the appropriate version of the Xcode command line tools:
https://developer.apple.com/download/more/?name=command%20line%20tools
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:
json
gem to 1.8.2
version. -- Preferableruby-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 detailsgem install json -v '1.8.2' worked for me.