I want to try out a Rails 4.2 app on Ruby 2.4.
However, when I try doing it, I get errors about the json gem version 1.8.3 failing to install.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/agrimm/.rbenv/versions/2.4.0-rc1/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
/Users/agrimm/.rbenv/versions/2.4.0-rc1/bin/ruby -r ./siteconf20161223-91367-cql0ne.rb extconf.rb
creating Makefile
current directory: /Users/agrimm/.rbenv/versions/2.4.0-rc1/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /Users/agrimm/.rbenv/versions/2.4.0-rc1/lib/ruby/gems/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c:861:25: error: use of undeclared identifier 'rb_cFixnum'
} else if (klass == rb_cFixnum) {
^
generator.c:863:25: error: use of undeclared identifier 'rb_cBignum'
} else if (klass == rb_cBignum) {
^
2 errors generated.
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/agrimm/.rbenv/versions/2.4.0-rc1/lib/ruby/gems/2.4.0/gems/json-1.8.3 for inspection.
Results logged to /Users/agrimm/.rbenv/versions/2.4.0-rc1/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-14/2.4.0-static/json-1.8.3/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
which I assume is due to the unification of Fixnum and Bignum into Integer.
If I add to the Gemfile a constraint that json has to be version 2.0.0, then it complains that Rails 4.2 requires json ~> 1.7, which forbids 2.0.0.
Am I out of luck unless the maintainers of Rails decide to make a change to a non-5.x version of Rails, or the maintainers of the json gem decide to make a new non-2.x version of their gem?
1.8.5
) and arel (6.0.4
) have been released. The main thing we're waiting on now is a new rails4.2.x
release. – Radiolocation