Error Installing JSON 1.8.3 with Ruby 2.4

Error installing json 1.8.3 with ruby 2.4

I ran into the same issue recently as well, try and see if there's a newer version of whatever gem you're using that depends on json 1.8.3. This is happening because Ruby 2.4 unified Fixnum and Bignum into Integer. If you're able to upgrade to json 1.8.5 or higher, it should help fix your problems.

You could also try and update the gem you're using and try to relax the version constraints (I've found this to work with a lot of projects, but not all) like so:

gem 'json', '>= 1.8'

Error in installing json 1.8.3 with ruby 2.4.0 on Ubuntu

I think you can solve your problem as:

sudo apt-get install libgmp3-dev

and if above command didn't solve your system, you can try to install this command:

sudo apt-get install libgmp-dev

You can refer at json-1.8.3 Gem::Ext::BuildError

Because your ruby version is 2.4.0.The ruby version is not compatible with json 1.8.3. You can try add this line in your Gemfile:

gem 'json', github: 'flori/json', branch: 'v1.8'

Ruby JSON gem install error: Ruby 2.4.1, JSON 1.8.6 (Windows 10)

Ruby 2.4 relies on json >= 2.0 and you are attempting to install json 1.8.6. They are incompatible. Ensure the two versions are compatible then retry your operation.

Unable to install json version 1.8.2 gem for Ruby version 2.5.3 on Ubuntu 20.04

You are trying to install a very old version of gem json from 2015.

This gem, depends on some ruby headers like Bignum which was removed on recent versions of ruby.

Try to install a more recent version of this gem like:

gem install json -v '2.5.1' --source 'https://rubygems.org/'

Or, you can try to downgrade your ruby version to 2.3.0 and try to install the json version on 1.8.3.

An error occurred while installing json (1.8.1) and Bundler cannot continue

Try updating your Gemfile to use json@1.8.2 instead of 1.8.1 - according to this thread Ruby 2.2.x is incompatible with json 1.8.1.

1.8.2 should be functionally similar and not affect any of your other dependencies.

You can also run bundle update json to let bundler try to fix it for you - but that may put you at a much later version than 1.8.2, I'm not sure.

No harm in trying a couple things and reverting your changes.

Issue with json 1.8.1 in my gemfile?

According to this thread you might need to upgrade json to 1.8.3 in order to compile it with ruby 2.2 (I'm assuming you're using 2.2)

To update json, try to install it first with:

gem install json -v '1.8.3'

After that, update the json gem in you Gemfile with

bundle update json

If it won't work, than you probably need to update other gems in your Gemfile which require json < 1.8.3 (I can see sdoc (0.4.1) in the Gemfile.lock, for instance). Try to run bundle update (without params).

I'd also recommend to update bundler and rubygems.



Related Topics



Leave a reply



Submit