Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON 1.8.3 is not compatible with ruby 2.4 preview #303

Closed
sivagollapalli opened this issue Sep 13, 2016 · 10 comments
Closed

JSON 1.8.3 is not compatible with ruby 2.4 preview #303

sivagollapalli opened this issue Sep 13, 2016 · 10 comments

Comments

@sivagollapalli
Copy link

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

    current directory: /home/siva/.rvm/gems/ruby-2.4.0-preview2/gems/json-1.8.3/ext/json/ext/generator
/home/siva/.rvm/rubies/ruby-2.4.0-preview2/bin/ruby -r ./siteconf20160913-31695-1hgh0cs.rb extconf.rb
creating Makefile

current directory: /home/siva/.rvm/gems/ruby-2.4.0-preview2/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/siva/.rvm/gems/ruby-2.4.0-preview2/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
     } else if (klass == rb_cFixnum) {
                         ^
generator.c:861:25: note: each undeclared identifier is reported only once for each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
     } else if (klass == rb_cBignum) {
                         ^
generator.c: At top level:
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/siva/.rvm/gems/ruby-2.4.0-preview2/gems/json-1.8.3 for inspection.
Results logged to /home/siva/.rvm/gems/ruby-2.4.0-preview2/extensions/x86_64-linux/2.4.0/json-1.8.3/gem_make.out

Because of this I couldn't upgrade my rails 4.2.5 app as I am getting this error

Bundler could not find compatible versions for gem "json":
  In Gemfile:
    json (~> 2.0.2)

    rails (= 4.2.5) was resolved to 4.2.5, which depends on
      activerecord (= 4.2.5) was resolved to 4.2.5, which depends on
        activesupport (= 4.2.5) was resolved to 4.2.5, which depends on
          json (>= 1.7.7, ~> 1.7)

    uglifier (>= 1.0.3) was resolved to 2.7.2, which depends on
      json (>= 1.8.0)

As per my knowledge this issue has been raised because of ruby unification integer.

@jerhinesmith
Copy link

Running into the same issues. Happy to provide any additional information if it would be helpful.

@ab
Copy link

ab commented Oct 10, 2016

See also #286, which was closed without comment.

@alepore
Copy link
Member

alepore commented Nov 9, 2016

you have to use the 2.0 version with ruby 2.4

@rhymes
Copy link

rhymes commented Dec 13, 2016

@alepore that's not doable if you're stuck on Rails 4.2.x - for example from my Gemfile.lock

    activesupport (4.2.7.1)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)

@rhymes
Copy link

rhymes commented Dec 25, 2016

Could it be possible to backport the integer unification commit? 8e16a60

ashmaroli added a commit to ashmaroli/jekyll that referenced this issue Dec 25, 2016
  - json: "~>2.0"
    # ruby/json#303 (comment)

  - pygments.rb: "~>1.1"
ashmaroli added a commit to ashmaroli/jekyll that referenced this issue Dec 25, 2016
  - json: "~> 2.0"
    # ruby/json#303 (comment)

  - pygments.rb: "~> 1.1"
@esilverberg
Copy link

esilverberg commented Dec 25, 2016

In case it matters, aws-sdk-v1 depends on ~> json 1.4, and upgrading to aws-sdk v2 is a major project we hope to do later next year.

This json incompatibility blocks us from going to ruby 2.3 to 2.4 today :\

bestie added a commit to bestie/terrestrial that referenced this issue Dec 25, 2016
Ruby 2.4.0 does not work with version 1.8.3 of the JSON gem which was
required by ActiveSupport 4.x. Allowing use of ActiveSupport 5.x in turn
allows use of JSON 2.x which is compatible with 2.4.0

ruby/json#303
@hsbt
Copy link
Member

hsbt commented Dec 26, 2016

@rhymes I already removed json dependency on 4-2-stable branch of rails/rails. see rails/rails#26334

You can use Ruby 2.4.0 with Rails 4.2.8 that is next minor release.

Tenzer added a commit to Tenzer/dockerfiles that referenced this issue Dec 29, 2016
fpm depends on 'json < 2.0, >= 1.7.7', but unfortunately json versions
before 2.0 does not support Ruby 2.4, see:
ruby/json#303
trstephen added a commit to DistributedDesigns/distributeddesigns.github.io that referenced this issue Jan 1, 2017
- needs ruby < 2.4.0 due to conflict with son 1.8.3
- see ruby/json#303
@zirikatzaile
Copy link

I've never seen such a complicated to get working language. For God sake !!! Thru the years I've used apt, rvm, rbenv, chruby ..... nightmare. Always spending much more time setting up than developing !!!

jrafanie added a commit to jrafanie/parallel that referenced this issue May 8, 2017
jrafanie added a commit to jrafanie/parallel that referenced this issue May 8, 2017
jrafanie added a commit to jrafanie/fast_gettext that referenced this issue May 8, 2017
garriguv added a commit to garriguv/Sourcery that referenced this issue May 12, 2017
bundle install failed on my machine because I use ruby 2.4.1 and the
json gem version 1.8.3 was not compatible.

This problem has now been fixed:
ruby/json#303
eddsteel added a commit to eddsteel/scala.github.com that referenced this issue Jun 26, 2017
kpshek added a commit to cds-hooks/docs that referenced this issue Jul 26, 2017
Dieterbe added a commit to grafana/metrictank that referenced this issue Jan 3, 2018
because we need ruby stuff, not go stuff

note:
- ruby 2.3 because json library that fpm seemingly wants to use
  doesn't work with 2.4 (ruby/json#303)
- for some reason apt-get update no longer needed
Dieterbe added a commit to grafana/metrictank that referenced this issue Jan 22, 2018
because we need ruby stuff, not go stuff

note:
- ruby 2.3 because json library that fpm seemingly wants to use
  doesn't work with 2.4 (ruby/json#303)
- for some reason apt-get update no longer needed
stephenyeargin added a commit to yeargin/yeargin.github.io that referenced this issue Feb 13, 2018
Jekyll would not compile against `json-1.8.3` on Ruby 2.4.

Reference: ruby/json#303
phallstrom added a commit to phallstrom/homebrew-bundle that referenced this issue Oct 1, 2018
Version 1.8.3 of the json gem isn't compatable with ruby 2.4 and later.
see: ruby/json#303

Specifically require the json gem to ensure we fetch a compatible
version.
phallstrom added a commit to phallstrom/homebrew-bundle that referenced this issue Oct 1, 2018
Version 1.8.3 of the json gem isn't compatable with ruby 2.4 and later.
see: ruby/json#303

Specifically require the json gem to ensure we fetch a compatible
version.
@hsbt
Copy link
Member

hsbt commented Jun 25, 2020

Ruby 2.4 is already EOL. This issues was resolved at the latest stable versions.

@hsbt hsbt closed this as completed Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants