Skip to content

Install as a default gem again

Tom Hebb requested to merge tchebb/ruby-json:make-default-again into main

json is a default gem (see https://stdgems.org/), which means it must be installed in /usr/lib/ruby/3.0.0/, instead of /usr/lib/ruby/gems/3.0.0/, and various other files must be relocated.

commit 62c22c73 ("Apply ruby package guidelines") removed the code that performed those fixups, causing json to be installed as a non-default gem. As a result, it can no longer be loaded from environments that don't include /usr/lib/ruby/gems/3.0.0 in GEM_PATH (e.g. bundle exec).

Fix this in the same way other default gems, like ruby-cgi, did. This commit closely follows ruby-cgi's, and I've tested it by verifying require "json" now works in Bundler environments and by checking the list of installed files against those in an rbenv-built Ruby 3.0.6.

Merge request reports

Loading