2

I encountered a weird problem. In the Gemfile.lock, it states json (1.8.6).

Basically, I can use bundle install to install json-1.8.6.

However, it still threw the following error when I run rspec command.

Could not find json-1.8.6 in any of the sources
Run `bundle install` to install missing gems.

Bundler version 1.15.0

Ruby 2.3.3

ggorlen
  • 44,755
  • 7
  • 76
  • 106
rj487
  • 4,476
  • 6
  • 47
  • 88

2 Answers2

1

Check your ruby source in gemfile should be: source 'https://rubygems.org'

or try adding the github path of the gem:

gem 'json', :git => 'https://github.com/flori/json.git'

Also try doing a bundle update.

If none of these work, please post your gemfile.

slal
  • 2,657
  • 18
  • 29
  • I thought it's not about the `gemfile`, because my co-worker shares the same gem file. I notice that the result in `gem list` is `json (1.8.6, default: 1.8.3)`, maybe the 1.8.3 cause this error. – rj487 Jun 02 '17 at 19:53
  • did you try `bundle update` then, or try to delete your Gemfile.lock and then do a `bundle install` – slal Jun 02 '17 at 19:55
  • I try, and it both fails. – rj487 Jun 04 '17 at 15:34
  • Still the same error, I am tying reinstall `rvm` and `ruby` now. – rj487 Jun 04 '17 at 16:24
  • Magically, after I run the command `rake db:test:prepare`, it fix this problem. – rj487 Jun 05 '17 at 08:59
  • Coda Chang, Please take a look at [this](https://github.com/heroku/heroku-buildpack-ruby/issues/578), I think there may be some issue in Bundle version 1.15. – Joseworks Jun 28 '17 at 14:27
-1

I have had similar problem recently and couldn't install one of the gems. I am not sure why, but I think it's because of the new Windows update (just a blind shot)

I have managed to repair it with reinstalling Ruby and devkit for it.

Good luck!

Adamosch
  • 33
  • 5