Bug 1308992 - json isn't found
json isn't found
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ruby (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Vít Ondruch
Miroslav Hradílek
Lenka Špačková
Depends On: 1428369
Blocks: 1380359 1393868
  Show dependency treegraph
Reported: 2016-02-16 11:38 EST by Renich Bon Ciric
Modified: 2017-08-01 16:56 EDT (History)
3 users (show)

See Also:
Fixed In Version: ruby-
Doc Type: Release Note
Doc Text:
Applications using *Bundler* to manage dependencies can now properly load the *JSON* library Previously, when *Bundler* was used to manage *Ruby* application dependencies, it was sometimes impossible to load the *JSON* library. Consequently, the application failed with a `LoadError`. This caused problems especially because *Ruby on Rails* no longer explicitly specifies dependency on the *JSON* library. With this update, *JSON* is always available on the load path, and the described problem no longer occurs.
Story Points: ---
Clone Of:
Last Closed: 2017-08-01 16:56:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Renich Bon Ciric 2016-02-16 11:38:36 EST
The json gem is never found when using bundler. This points to a configuration problem. Check this bug for reference: https://github.com/hanami/hanami/issues/512

On Funtoo/Gentoo, the exact same example works fine.
Comment 2 Vít Ondruch 2016-06-07 08:07:54 EDT
Hello Renich,

We are still evaluating how to tackle this. For the time being, please add json into your package dependencies or into your application Gemfile. If this is urgent matter for you, please contact Red Hat support to help us prioritize this issue.
Comment 3 Renich Bon Ciric 2016-06-07 14:27:17 EDT
Thanks for the update Vit.
Comment 4 Vít Ondruch 2016-10-10 10:43:57 EDT
Due to Ruby on Rails 5.0 support, we were forced to narrow this in Fedora, so I think it is reasonable to apply the same patch in RHEL as well.

[1] http://pkgs.fedoraproject.org/cgit/rpms/ruby.git/commit/ruby.spec?id=b1466a4c8f2cd28556efcd93c5dc539bff041be9
Comment 7 Vít Ondruch 2017-03-06 07:40:42 EST
This should always work:

$ ruby -e "p(require 'json')"

Give these prerequisites:

$ bundle init

$ cat Gemfile 
# A sample Gemfile
source "https://rubygems.org"

# gem "rails"

$ bundle install
The Gemfile specifies no dependencies
Resolving dependencies...
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.

This does not work with current ruby-

$ bundle exec ruby -e "p(require 'json')"
-e:1:in `require': cannot load such file -- json (LoadError)
	from -e:1:in `<main>'

but it should be fixed by ruby-

$ bundle exec ruby -e "p(require 'json')"
Comment 12 errata-xmlrpc 2017-08-01 16:56:55 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.