rubygems / rubygems

Library packaging and distribution for Ruby.
https://rubygems.org/
Other
3.67k stars 1.74k forks source link

running into error with"brew test lammps -v" #6460

Closed zlw523190330 closed 1 year ago

zlw523190330 commented 1 year ago

i'm seeing the below error message running "brew test lammps -v"

/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/bin/bundle install /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin22/rbconfig.rb:21: warning: Insecure world writable dir /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0 in PATH, mode 040777 Fetching gem metadata from https://rubygems.org/....... Using minitest 5.18.0 Using ast 2.4.2 Installing zeitwerk 2.6.7 Using msgpack 1.6.1 Using bundler 2.3.26 Using byebug 11.1.3 Using connection_pool 2.3.0 Installing bindata 2.4.15 Using diff-lcs 1.5.0 Using docile 1.4.0 Using unf_ext 0.0.8.2 Using regexp_parser 2.7.0 Using hana 1.3.7 Using hpricot 0.8.6 Using json 2.6.3 Using uri_template 0.7.0 Using mime-types-data 3.2023.0218.1 Installing public_suffix 5.0.1 Using net-http-digest_auth 1.4.1 Using racc 1.6.2 Installing did_you_mean 1.6.3 Using webrobots 0.1.2 Using mustache 1.1.1 Using parallel 1.22.1 Installing rubyntlm 0.6.3 It is a security vulnerability to allow your home directory to be world-writable, and bundler cannot continue. You should probably consider fixing this issue by running chmod o-w ~ on *nix. Please refer to https://ruby-doc.org/stdlib-3.1.2/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure for details. Installing plist 3.7.0 Using rainbow 3.1.1 Using rdiscount 2.2.7 Using rexml 3.2.5 Using rspec-support 3.12.0 Installing webrick 1.8.1 Installing ruby-progressbar 1.13.0 Installing rack 3.0.4.2 Using unicode-display_width 2.4.2 Installing sorbet-runtime 0.5.10461 Installing concurrent-ruby 1.2.2 Using simplecov-html 0.12.3 Installing simplecov_json_formatter 0.1.4 Installing ruby-macho 3.0.0 Installing warning 1.3.0 Using parser 3.2.1.1 --- ERROR REPORT TEMPLATE -------------------------------------------------------

ArgumentError: parent directory is world writable, Bundler::FileUtils#remove_entry_secure does not work; abort: "/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.6.7" (parent directory mode 40777)
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/vendor/fileutils/lib/fileutils.rb:702:in `remove_entry_secure'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler.rb:330:in `rm_rf'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:111:in `strict_rm_rf'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/rubygems_gem_installer.rb:19:in `install'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/source/rubygems.rb:207:in `install'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:54:in `install'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/worker.rb:62:in `apply_func'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/worker.rb:57:in `block in process_queue'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in `loop'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/worker.rb:54:in `process_queue'
  /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/bundler-2.3.26/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

Environment

Bundler       2.3.26
  Platforms   ruby, arm64-darwin-22
Ruby          2.6.10p210 (2022-04-12 revision 67958) [arm64-darwin-22]
  Full Path   /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
  Config Dir  /Library/Ruby/Site
RubyGems      3.0.3.1
  Gem Home    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0
  Gem Path    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0
  User Home   /Users/lwzhang
  User Path   /Users/lwzhang/.gem/ruby/2.6.0
  Bin Dir     /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/bin
OpenSSL       
  Compiled    LibreSSL 2.8.3
  Loaded      LibreSSL 2.8.3
  Cert File   /private/etc/ssl/cert.pem
  Cert Dir    /private/etc/ssl/certs
Tools         
  Git         2.37.1 (Apple Git-137.1)
  RVM         not installed
  rbenv       not installed
  chruby      not installed

Bundler Build Metadata

Built At          2022-11-17
Git SHA           23ec5b8501
Released Version  true

Bundler settings

bin
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): false
clean
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): true
disable_shared_gems
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): true
force_ruby_platform
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): false
forget_cli_options
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): true
frozen
  Set via BUNDLE_FROZEN: true
gemfile
  Set via BUNDLE_GEMFILE: "/opt/homebrew/Library/Homebrew/Gemfile"
jobs
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): 4
path
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): "vendor/bundle"
retry
  Set for your local app (/opt/homebrew/Library/Homebrew/.bundle/config): 3
with
  Set via BUNDLE_WITH: []

Gemfile

../../opt/homebrew/Library/Homebrew/Gemfile

# frozen_string_literal: true

source "https://rubygems.org"

if ENV.fetch("HOMEBREW_DEVELOPER", "").empty? || ENV.fetch("HOMEBREW_USE_RUBY_FROM_PATH", "").empty?
  ruby "~> 2.6.0"
else
  ruby ">= 2.6.0"
end

# disallowed gems (should not be used)
# * nokogiri - use rexml instead for XML parsing

# installed gems (should all be require: false)
gem "bootsnap", require: false
gem "byebug", require: false
gem "json_schemer", require: false
gem "minitest", require: false
gem "parallel_tests", require: false
gem "ronn", require: false
gem "rspec", require: false
gem "rspec-github", require: false
gem "rspec-its", require: false
gem "rspec_junit_formatter", require: false
gem "rspec-retry", require: false
gem "rspec-sorbet", require: false
gem "rubocop", require: false
gem "rubocop-ast", require: false
gem "simplecov", require: false
gem "simplecov-cobertura", require: false
gem "warning", require: false

group :sorbet, optional: true do
  gem "parlour", require: false
  gem "sorbet-static-and-runtime", require: false
  gem "spoom", require: false
  gem "tapioca", require: false
end

# vendored gems
gem "activesupport"
gem "addressable"
gem "concurrent-ruby"
gem "mechanize"
gem "patchelf"
gem "plist"
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rspec"
gem "rubocop-sorbet"
gem "ruby-macho"
gem "sorbet-runtime"

# remove when HOMEBREW_REQUIRED_RUBY_VERSION >= 2.7
install_if -> { RUBY_VERSION < "2.7" } do
  gem "did_you_mean"
end

../../opt/homebrew/Library/Homebrew/Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (6.1.7.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    addressable (2.8.1)
      public_suffix (>= 2.0.2, < 6.0)
    ast (2.4.2)
    bindata (2.4.15)
    bootsnap (1.16.0)
      msgpack (~> 1.2)
    byebug (11.1.3)
    coderay (1.1.3)
    commander (4.6.0)
      highline (~> 2.0.0)
    concurrent-ruby (1.2.2)
    connection_pool (2.3.0)
    did_you_mean (1.6.3)
    diff-lcs (1.5.0)
    docile (1.4.0)
    domain_name (0.5.20190701)
      unf (>= 0.0.5, < 1.0.0)
    ecma-re-validator (0.4.0)
      regexp_parser (~> 2.2)
    elftools (1.2.0)
      bindata (~> 2)
    hana (1.3.7)
    highline (2.0.3)
    hpricot (0.8.6)
    http-cookie (1.0.5)
      domain_name (~> 0.5)
    i18n (1.12.0)
      concurrent-ruby (~> 1.0)
    json (2.6.3)
    json_schemer (0.2.24)
      ecma-re-validator (~> 0.3)
      hana (~> 1.3)
      regexp_parser (~> 2.0)
      uri_template (~> 0.7)
    mechanize (2.8.5)
      addressable (~> 2.8)
      domain_name (~> 0.5, >= 0.5.20190701)
      http-cookie (~> 1.0, >= 1.0.3)
      mime-types (~> 3.0)
      net-http-digest_auth (~> 1.4, >= 1.4.1)
      net-http-persistent (>= 2.5.2, < 5.0.dev)
      nokogiri (~> 1.11, >= 1.11.2)
      rubyntlm (~> 0.6, >= 0.6.3)
      webrick (~> 1.7)
      webrobots (~> 0.1.2)
    method_source (1.0.0)
    mime-types (3.4.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2023.0218.1)
    mini_portile2 (2.8.1)
    minitest (5.18.0)
    msgpack (1.6.1)
    mustache (1.1.1)
    net-http-digest_auth (1.4.1)
    net-http-persistent (4.0.1)
      connection_pool (~> 2.2)
    nokogiri (1.13.10)
      mini_portile2 (~> 2.8.0)
      racc (~> 1.4)
    nokogiri (1.13.10-aarch64-linux)
      racc (~> 1.4)
    nokogiri (1.13.10-arm64-darwin)
      racc (~> 1.4)
    nokogiri (1.13.10-x86_64-darwin)
      racc (~> 1.4)
    nokogiri (1.13.10-x86_64-linux)
      racc (~> 1.4)
    parallel (1.22.1)
    parallel_tests (3.13.0)
      parallel
    parlour (8.1.0)
      commander (~> 4.5)
      parser
      rainbow (~> 3.0)
      sorbet-runtime (>= 0.5)
    parser (3.2.1.1)
      ast (~> 2.4.1)
    patchelf (1.4.0)
      elftools (>= 1.2)
    plist (3.7.0)
    pry (0.14.2)
      coderay (~> 1.1)
      method_source (~> 1.0)
    public_suffix (5.0.1)
    racc (1.6.2)
    rack (3.0.4.2)
    rainbow (3.1.1)
    rbi (0.0.14)
      ast
      parser (>= 2.6.4.0)
      sorbet-runtime (>= 0.5.9204)
      unparser
    rdiscount (2.2.7)
    regexp_parser (2.7.0)
    rexml (3.2.5)
    ronn (0.7.3)
      hpricot (>= 0.8.2)
      mustache (>= 0.7.0)
      rdiscount (>= 1.5.8)
    rspec (3.12.0)
      rspec-core (~> 3.12.0)
      rspec-expectations (~> 3.12.0)
      rspec-mocks (~> 3.12.0)
    rspec-core (3.12.1)
      rspec-support (~> 3.12.0)
    rspec-expectations (3.12.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.12.0)
    rspec-github (2.4.0)
      rspec-core (~> 3.0)
    rspec-its (1.3.0)
      rspec-core (>= 3.0.0)
      rspec-expectations (>= 3.0.0)
    rspec-mocks (3.12.3)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.12.0)
    rspec-retry (0.6.2)
      rspec-core (> 3.3)
    rspec-sorbet (1.9.1)
      sorbet-runtime
    rspec-support (3.12.0)
    rspec_junit_formatter (0.6.0)
      rspec-core (>= 2, < 4, != 2.12.0)
    rubocop (1.48.0)
      json (~> 2.3)
      parallel (~> 1.10)
      parser (>= 3.2.0.0)
      rainbow (>= 2.2.2, < 4.0)
      regexp_parser (>= 1.8, < 3.0)
      rexml (>= 3.2.5, < 4.0)
      rubocop-ast (>= 1.26.0, < 2.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 2.4.0, < 3.0)
    rubocop-ast (1.27.0)
      parser (>= 3.2.1.0)
    rubocop-capybara (2.17.1)
      rubocop (~> 1.41)
    rubocop-performance (1.16.0)
      rubocop (>= 1.7.0, < 2.0)
      rubocop-ast (>= 0.4.0)
    rubocop-rails (2.18.0)
      activesupport (>= 4.2.0)
      rack (>= 1.1)
      rubocop (>= 1.33.0, < 2.0)
    rubocop-rspec (2.19.0)
      rubocop (~> 1.33)
      rubocop-capybara (~> 2.17)
    rubocop-sorbet (0.7.0)
      rubocop (>= 0.90.0)
    ruby-macho (3.0.0)
    ruby-progressbar (1.13.0)
    rubyntlm (0.6.3)
    simplecov (0.22.0)
      docile (~> 1.1)
      simplecov-html (~> 0.11)
      simplecov_json_formatter (~> 0.1)
    simplecov-cobertura (2.1.0)
      rexml
      simplecov (~> 0.19)
    simplecov-html (0.12.3)
    simplecov_json_formatter (0.1.4)
    sorbet (0.5.10461)
      sorbet-static (= 0.5.10461)
    sorbet-runtime (0.5.10461)
    sorbet-static (0.5.10461-universal-darwin-14)
    sorbet-static (0.5.10461-universal-darwin-15)
    sorbet-static (0.5.10461-universal-darwin-16)
    sorbet-static (0.5.10461-universal-darwin-17)
    sorbet-static (0.5.10461-universal-darwin-18)
    sorbet-static (0.5.10461-universal-darwin-19)
    sorbet-static (0.5.10461-universal-darwin-20)
    sorbet-static (0.5.10461-universal-darwin-21)
    sorbet-static (0.5.10461-universal-darwin-22)
    sorbet-static (0.5.10461-x86_64-linux)
    sorbet-static-and-runtime (0.5.10461)
      sorbet (= 0.5.10461)
      sorbet-runtime (= 0.5.10461)
    spoom (1.1.11)
      sorbet (>= 0.5.9204)
      sorbet-runtime (>= 0.5.9204)
      thor (>= 0.19.2)
    tapioca (0.7.3)
      bundler (>= 1.17.3)
      pry (>= 0.12.2)
      rbi (~> 0.0.0, >= 0.0.14)
      sorbet-runtime (>= 0.5.9204)
      sorbet-static (>= 0.5.9204)
      spoom (~> 1.1.0, >= 1.1.11)
      thor (>= 1.2.0)
      yard-sorbet
    thor (1.2.1)
    tzinfo (2.0.6)
      concurrent-ruby (~> 1.0)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.8.2)
    unicode-display_width (2.4.2)
    unparser (0.6.4)
      diff-lcs (~> 1.3)
      parser (>= 3.1.0)
    uri_template (0.7.0)
    warning (1.3.0)
    webrick (1.8.1)
    webrobots (0.1.2)
    yard (0.9.26)
    yard-sorbet (0.6.1)
      sorbet-runtime (>= 0.5)
      yard (>= 0.9)
    zeitwerk (2.6.7)

PLATFORMS
  aarch64-linux
  arm-linux
  arm64-darwin
  x86_64-darwin
  x86_64-linux

DEPENDENCIES
  activesupport
  addressable
  bootsnap
  byebug
  concurrent-ruby
  did_you_mean
  json_schemer
  mechanize
  minitest
  parallel_tests
  parlour
  patchelf
  plist
  ronn
  rspec
  rspec-github
  rspec-its
  rspec-retry
  rspec-sorbet
  rspec_junit_formatter
  rubocop
  rubocop-ast
  rubocop-performance
  rubocop-rails
  rubocop-rspec
  rubocop-sorbet
  ruby-macho
  simplecov
  simplecov-cobertura
  sorbet-runtime
  sorbet-static-and-runtime
  spoom
  tapioca
  warning

RUBY VERSION
   ruby 2.6.8p205

BUNDLED WITH
   2.3.26

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error: https://github.com/rubygems/rubygems/search?q=parent+directory+is+world+writable%2C+Bundler++FileUtils%23remove_entry_secure+does+not+work%3B+abort++%22%2Fopt%2Fhomebrew%2FLibrary%2FHomebrew%2Fvendor%2Fbundle%2Fruby%2F2.6.0%2Fgems%2Fzeitwerk-2.6.7%22+%28parent+directory+mode+40777%29&type=Issues

If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there. Error: failed to run /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/bin/bundle install!

deivid-rodriguez commented 1 year ago

Hei! Sorry for the delay.

This was a permissions issue that was making Bundler fail to remove the previous installation of gems before reinstalling.

It was a bug though that we were showing the bug report template here, but this has been fixed in recent Bundler versions and we should now be raising a better actionable error without a bug report template.

So I'm going to close this since it's also quite old. If you're still having issues, let us know and we'll hopefully be more responsive next time!

Regards!