8
votes

I tried to run the bundle install command and I got the following errors. After reading some stackoverflow posts, I also ran bundle update.

I am still getting the issue of json ~ 1.8.6 gem (I guess).

An error occurred while installing json (1.8.6), and Bundler cannot continue. Make sure that gem install json -v '1.8.6' succeeds before bundling. Here the issue is not getting installation done properly.

I tried installing gem separately.But still the problem exists.

2
try installing gem install json -v '1.8.6' manually in command line first - Haider Ali
@TomLord I did the generic way and it worked. Thanks!! - Franklin Antony
@HaiderAli Thanks, I've written the answer for it with yours and TomLord 's inputs. Hope this would be effective for others. - Franklin Antony

2 Answers

1
votes

Older versions of json gem have some incompatibilities with newer ruby. Try to update json gem bundle update json

1
votes

This can be solved by doing the following

1. Installing the ruby development environment by running the following command(for Linux machines).

sudo apt-get install ruby
ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]' -dev

Read this post for more details.

2. Now install the json -v '1.8.6' gem by running the following command.

sudo gem install json -v '1.8.6'

This should solve the issue. Now try running bundle update and bundle install and it should work fine.

Thanks @TomLord and @Haider Ali for your inputs.