diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index b944a050a3..060c82d02c 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -42,6 +42,7 @@ # #files are the files in the .gem tar file, not the Ruby files in the gem # #extract_files and #contents automatically call #verify +require "rubygems" require 'rubygems/security' require 'rubygems/specification' require 'rubygems/user_interaction' diff --git a/test/rubygems/test_project_sanity.rb b/test/rubygems/test_project_sanity.rb index 6a9eb3b83f..f3f111b25b 100644 --- a/test/rubygems/test_project_sanity.rb +++ b/test/rubygems/test_project_sanity.rb @@ -12,4 +12,10 @@ class TestProjectSanity < Minitest::Test assert status.success?, "Expected Manifest.txt to be up to date, but it's not. Run `rake update_manifest` to sync it." end + def test_require_rubygems_package + _, status = Open3.capture2e("ruby -v --disable-gems -I 'lib' -e 'require \"rubygems/package\"'") + + assert status.success? + end + end