Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1308992

Summary: json isn't found
Product: Red Hat Enterprise Linux 7 Reporter: Renich Bon Ciric <renich>
Component: rubyAssignee: Vít Ondruch <vondruch>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: unspecified Docs Contact: Lenka Špačková <lkuprova>
Priority: unspecified    
Version: 7.4CC: isenfeld, mhradile, toneata, vondruch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ruby-2.0.0.648-30.el7 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: Environment:
Last Closed: 2017-08-01 20:56:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1428369    
Bug Blocks: 1380359, 1393868    

Description Renich Bon Ciric 2016-02-16 16:38:36 UTC
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 12:07:54 UTC
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 18:27:17 UTC
Thanks for the update Vit.

Comment 4 Vít Ondruch 2016-10-10 14:43:57 UTC
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 12:40:42 UTC
This should always work:

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

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-2.0.0.648-29.el7

~~~
$ 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-2.0.0.648-30.el7:

~~~
$ bundle exec ruby -e "p(require 'json')"
true
~~~

Comment 12 errata-xmlrpc 2017-08-01 20:56:55 UTC
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.

https://access.redhat.com/errata/RHBA-2017:2037