Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gem error at 2.7/stable on CentOS #21

Open
alpha3166 opened this issue May 6, 2020 · 0 comments
Open

gem error at 2.7/stable on CentOS #21

alpha3166 opened this issue May 6, 2020 · 0 comments

Comments

@alpha3166
Copy link

When I install 2.7/stable with snap on CentOS 7 and 8, I get the following error in gem. bundle, irb, rake, rdoc and ri also get the same error.

$ gem -v
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:12: warning: already initialized constant Gem::VERSION
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:12: warning: previous definition of VERSION was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:15: warning: already initialized constant Gem::RubyGemsVersion
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:15: warning: previous definition of RubyGemsVersion was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:18: warning: already initialized constant Gem::RbConfigPriorities
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:18: warning: previous definition of RbConfigPriorities was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:27: warning: constant Gem::ConfigMap is deprecated
/snap/ruby/181/lib/ruby/2.7.0/rubygems/compatibility.rb:36: warning: constant Gem::ConfigMap is deprecated
/snap/ruby/181/lib/ruby/2.7.0/rubygems/defaults.rb:3: warning: already initialized constant Gem::DEFAULT_HOST
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/defaults.rb:3: warning: previous definition of DEFAULT_HOST was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:116: warning: already initialized constant Gem::RUBYGEMS_DIR
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:116: warning: previous definition of RUBYGEMS_DIR was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:121: warning: already initialized constant Gem::UNTAINT
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:121: warning: previous definition of UNTAINT was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:126: warning: already initialized constant Gem::WIN_PATTERNS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:126: warning: previous definition of WIN_PATTERNS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:135: warning: already initialized constant Gem::GEM_DEP_FILES
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:135: warning: previous definition of GEM_DEP_FILES was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:145: warning: already initialized constant Gem::REPOSITORY_SUBDIRECTORIES
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:145: warning: previous definition of REPOSITORY_SUBDIRECTORIES was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:157: warning: already initialized constant Gem::REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:157: warning: previous definition of REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:165: warning: already initialized constant Gem::READ_BINARY_ERRORS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:165: warning: previous definition of READ_BINARY_ERRORS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:170: warning: already initialized constant Gem::WRITE_BINARY_ERRORS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:170: warning: previous definition of WRITE_BINARY_ERRORS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:177: warning: already initialized constant Gem::LOADED_SPECS_MUTEX
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:177: warning: previous definition of LOADED_SPECS_MUTEX was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:1367: warning: already initialized constant Gem::MARSHAL_SPEC_DIR
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:1367: warning: previous definition of MARSHAL_SPEC_DIR was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/version.rb:158: warning: already initialized constant Gem::Version::VERSION_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/version.rb:158: warning: previous definition of VERSION_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/version.rb:159: warning: already initialized constant Gem::Version::ANCHORED_VERSION_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/version.rb:159: warning: previous definition of ANCHORED_VERSION_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:14: warning: already initialized constant Gem::Requirement::OPS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:14: warning: previous definition of OPS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:24: warning: already initialized constant Gem::Requirement::SOURCE_SET_REQUIREMENT
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:24: warning: previous definition of SOURCE_SET_REQUIREMENT was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:27: warning: already initialized constant Gem::Requirement::PATTERN_RAW
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:27: warning: previous definition of PATTERN_RAW was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:32: warning: already initialized constant Gem::Requirement::PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:32: warning: previous definition of PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:37: warning: already initialized constant Gem::Requirement::DefaultRequirement
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:37: warning: previous definition of DefaultRequirement was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:42: warning: already initialized constant Gem::Requirement::DefaultPrereleaseRequirement
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:42: warning: previous definition of DefaultPrereleaseRequirement was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:311: warning: already initialized constant Gem::Version::Requirement
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/requirement.rb:311: warning: previous definition of Requirement was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/platform.rb:198: warning: already initialized constant Gem::Platform::RUBY
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/platform.rb:198: warning: previous definition of RUBY was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/platform.rb:204: warning: already initialized constant Gem::Platform::CURRENT
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/platform.rb:204: warning: previous definition of CURRENT was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:10: warning: already initialized constant Gem::StubSpecification::PREFIX
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:10: warning: previous definition of PREFIX was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:13: warning: already initialized constant Gem::StubSpecification::OPEN_MODE
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:13: warning: previous definition of OPEN_MODE was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:20: warning: already initialized constant Gem::StubSpecification::StubLine::NO_EXTENSIONS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:20: warning: previous definition of NO_EXTENSIONS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:23: warning: already initialized constant Gem::StubSpecification::StubLine::REQUIRE_PATHS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:23: warning: previous definition of REQUIRE_PATHS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:33: warning: already initialized constant Gem::StubSpecification::StubLine::REQUIRE_PATH_LIST
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/stub_specification.rb:33: warning: previous definition of REQUIRE_PATH_LIST was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/user_interaction.rb:565: warning: already initialized constant Gem::StreamUI::ThreadedDownloadReporter::MUTEX
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/user_interaction.rb:565: warning: previous definition of MUTEX was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:7: warning: already initialized constant Gem::SpecificationPolicy::VALID_NAME_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:7: warning: previous definition of VALID_NAME_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:9: warning: already initialized constant Gem::SpecificationPolicy::SPECIAL_CHARACTERS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:9: warning: previous definition of SPECIAL_CHARACTERS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:11: warning: already initialized constant Gem::SpecificationPolicy::VALID_URI_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:11: warning: previous definition of VALID_URI_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:13: warning: already initialized constant Gem::SpecificationPolicy::METADATA_LINK_KEYS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:13: warning: previous definition of METADATA_LINK_KEYS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:341: warning: already initialized constant Gem::SpecificationPolicy::LAZY
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:341: warning: previous definition of LAZY was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:342: warning: already initialized constant Gem::SpecificationPolicy::LAZY_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:342: warning: previous definition of LAZY_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:343: warning: already initialized constant Gem::SpecificationPolicy::HOMEPAGE_URI_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification_policy.rb:343: warning: previous definition of HOMEPAGE_URI_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:51: warning: already initialized constant Gem::Specification::NONEXISTENT_SPECIFICATION_VERSION
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:51: warning: previous definition of NONEXISTENT_SPECIFICATION_VERSION was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:74: warning: already initialized constant Gem::Specification::CURRENT_SPECIFICATION_VERSION
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:74: warning: previous definition of CURRENT_SPECIFICATION_VERSION was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:80: warning: already initialized constant Gem::Specification::SPECIFICATION_VERSION_HISTORY
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:80: warning: previous definition of SPECIFICATION_VERSION_HISTORY was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:98: warning: already initialized constant Gem::Specification::MARSHAL_FIELDS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:98: warning: previous definition of MARSHAL_FIELDS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:107: warning: already initialized constant Gem::Specification::TODAY
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:107: warning: previous definition of TODAY was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:110: warning: already initialized constant Gem::Specification::LOAD_CACHE
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:110: warning: previous definition of LOAD_CACHE was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:112: warning: already initialized constant Gem::Specification::LOAD_CACHE_MUTEX
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:112: warning: previous definition of LOAD_CACHE_MUTEX was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:116: warning: already initialized constant Gem::Specification::VALID_NAME_PATTERN
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:116: warning: previous definition of VALID_NAME_PATTERN was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:167: warning: already initialized constant Gem::Specification::INITIALIZE_CODE_FOR_DEFAULTS
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:167: warning: previous definition of INITIALIZE_CODE_FOR_DEFAULTS was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:192: warning: already initialized constant Gem::Specification::NOT_FOUND
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:192: warning: previous definition of NOT_FOUND was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:835: warning: already initialized constant Gem::Specification::EMPTY
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:835: warning: previous definition of EMPTY was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:1673: warning: already initialized constant Gem::Specification::DateLike
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:1673: warning: previous definition of DateLike was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:1678: warning: already initialized constant Gem::Specification::DateTimeFormat
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:1678: warning: previous definition of DateTimeFormat was here
/snap/ruby/181/lib/ruby/2.7.0/rubygems/exceptions.rb:292: warning: already initialized constant Gem::UnsatisfiableDepedencyError
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/exceptions.rb:292: warning: previous definition of UnsatisfiableDepedencyError was here
Traceback (most recent call last):
        5: from /var/lib/snapd/snap/ruby/181/bin/gem:8:in `<main>'
        4: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        3: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        2: from /snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:1397:in `<top (required)>'
        1: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- rubygems/defaults/operating_system (LoadError)
        14: from /var/lib/snapd/snap/ruby/181/bin/gem:8:in `<main>'
        13: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        12: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
        11: from /snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:1397:in `<top (required)>'
        10: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:156:in `require'
         9: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:161:in `rescue in require'
         8: from /snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:204:in `try_activate'
         7: from /snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:996:in `find_by_path'
         6: from /snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:815:in `stubs'
         5: from /snap/ruby/181/lib/ruby/2.7.0/rubygems/specification.rb:932:in `dirs'
         4: from /snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:420:in `path'
         3: from /snap/ruby/181/lib/ruby/2.7.0/rubygems.rb:374:in `paths'
         2: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
         1: from /var/lib/snapd/snap/ruby/181/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/snap/ruby/181/lib/ruby/2.7.0/rubygems/path_support.rb:7:in `<top (required)>': uninitialized constant Gem::PathSupport (NameError)

The reproducing procedure is as follows.

sudo yum upgrade -y
# reboot here
sudo yum install -y epel-release
sudo yum install -y snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
# logout and login here to reflect the PATH
sudo snap install ruby --classic --channel=2.7/stable
gem -v

This does not happen in 2.6/stable. Also, this does not happen on Ubuntu.

Distro 2.7/stable 2.6/stable
CentOS 7 Error Good
CentOS 8 Error Good
Ubuntu 18.04 Good Good
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant