Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find json-1.8.1 in any of the sources (Bundler::GemNotFound)

I am running the following stack:

  • ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
  • RubyGems 2.2.2
  • Rails 4.1.0
  • Bundler version 1.6.2

on ubuntu running apache

And I am getting the following error:

Could not find json-1.8.1 in any of the sources (Bundler::GemNotFound)

When I look for json as follows:

$ gem list | grep json

json (1.8.1)
multi_json (1.9.2)

It is there but for some reason, the message from Passenger is as follows:

Ruby (Rack) application could not be started

Error message: Could not find json-1.8.1 in any of the sources (Bundler::GemNotFound) Exception class: PhusionPassenger::UnknownError

like image 300
Arunabh Das Avatar asked Apr 21 '14 00:04

Arunabh Das


1 Answers

For me, this problem was caused by Spring (the Rails quick-loader) not picking up Gem/path changes. I was executing rails generate rspec:install and getting a json-1.8.1 not found.

I probably executed thirty different commands -- any of which probably had an impact to the final resolution -- but eventually doing a bin/spring stop allowed further rails commands to work because they restarted the Spring server with an updated Gem-list.

like image 148
twooster Avatar answered Sep 20 '22 22:09

twooster