Fixing pry under Ubuntu - ruby

I've installed new version of ruby - 1.9.3-p125 and then i've got the problem with pry
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:11: warning: already initialized constant DEFAULT_HOOKS
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:22: warning: already initialized constant DEFAULT_PRINT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:47: warning: already initialized constant SIMPLE_PRINT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:56: warning: already initialized constant CLIPPED_PRINT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:61: warning: already initialized constant DEFAULT_EXCEPTION_HANDLER
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:67: warning: already initialized constant DEFAULT_EXCEPTION_WHITELIST
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:70: warning: already initialized constant DEFAULT_PROMPT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:81: warning: already initialized constant SIMPLE_PROMPT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:83: warning: already initialized constant SHELL_PROMPT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:90: warning: already initialized constant NAV_PROMPT
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:106: warning: already initialized constant DEFAULT_CONTROL_D_HANDLER
/home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:120: warning: already initialized constant DEFAULT_SYSTEM
/home/megas/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- readline (LoadError)
from /home/megas/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/lib/pry.rb:163:in `<top (required)>'
from /home/megas/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/megas/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/bin/pry:12:in `rescue in <top (required)>'
from /home/megas/.rvm/gems/ruby-1.9.3-p125/gems/pry-0.9.8.2/bin/pry:8:in `<top (required)>'
from /home/megas/.rvm/gems/ruby-1.9.3-p125/bin/pry:19:in `load'
from /home/megas/.rvm/gems/ruby-1.9.3-p125/bin/pry:19:in `<main>'
I've tried to fix this problem by this article but after make command I got answer
Nothing to be done for `all’
How to resolve this problem? Thanks
P.S. Ubuntu 11.10, 64bit

Hey megas have you got lncurses installed? If not try:
sudo apt-get install libncurses5-dev libreadline5-dev
Got that from this Blogpost which seems to have some similarity to your problem.
Solution:
rvm uninstall 1.9.3-p125
sudo apt-get install libreadline-dev
rvm install 1.9.3-p125 --with-readline-dir=/usr/include/readline

Related

Ruby: Bundler's Mustermann `initialize` wrong number of arguments (given 2, expected 1) (ArgumentError)

I am following the steps of a GitHub tutorial on setting up a dev environment to create a GitHub app. Unfortunately, I'm stuck on Step 6 of the tutorial, as when I enter bundle exec ruby template_server.rb I receive this error:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-1.17.1/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann/regular.rb:22:in `initialize': wrong number of arguments (given 2, expected 1) (ArgumentError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann/pattern.rb:59:in `new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann/pattern.rb:59:in `block in new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann/equality_map.rb:43:in `fetch'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann/pattern.rb:59:in `new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann.rb:67:in `new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann.rb:70:in `block in new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann.rb:70:in `map'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mustermann-1.0.3/lib/mustermann.rb:70:in `new'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1641:in `compile'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1629:in `compile!'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1271:in `error'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:1838:in `<class:Base>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:894:in `<module:Sinatra>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/base.rb:22:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/main.rb:1:in `require'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra/main.rb:1:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra.rb:1:in `require'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sinatra-2.0.4/lib/sinatra.rb:1:in `<top (required)>'
from template_server.rb:1:in `require'
from template_server.rb:1:in `<main>'
I haven't changed either the Gemfile or the Gemfile.lock (they're the same as the ones in the tutorial so I provided their hyperlinks) and from what I've read so far there must be something outdated, but I'm not sure what exactly. Thanks!

superclass mismatch for class SpecificationPolicy

I'm getting a superclass mismatch for class SpecificationPolicy error when trying to install or upgrade certain brew packages.
For example, when updating installing the supabase CLI (brew install supabase/tap/supabase):
==> Installing supabase from supabase/tap
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:12: warning: already initialized constant Gem::VERSION
/Library/Ruby/Site/2.6.0/rubygems.rb:11: warning: previous definition of VERSION was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/compatibility.rb:14: warning: already initialized constant Gem::RubyGemsVersion
/Library/Ruby/Site/2.6.0/rubygems/compatibility.rb:15: warning: previous definition of RubyGemsVersion was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/compatibility.rb:18: warning: already initialized constant Gem::RbConfigPriorities
/Library/Ruby/Site/2.6.0/rubygems/compatibility.rb:18: warning: previous definition of RbConfigPriorities was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/compatibility.rb:27: warning: constant Gem::ConfigMap is deprecated
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/compatibility.rb:35: warning: constant Gem::ConfigMap is deprecated
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/defaults.rb:3: warning: already initialized constant Gem::DEFAULT_HOST
/Library/Ruby/Site/2.6.0/rubygems/defaults.rb:3: warning: previous definition of DEFAULT_HOST was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:117: warning: already initialized constant Gem::RUBYGEMS_DIR
/Library/Ruby/Site/2.6.0/rubygems.rb:115: warning: previous definition of RUBYGEMS_DIR was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:122: warning: already initialized constant Gem::WIN_PATTERNS
/Library/Ruby/Site/2.6.0/rubygems.rb:129: warning: previous definition of WIN_PATTERNS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:131: warning: already initialized constant Gem::GEM_DEP_FILES
/Library/Ruby/Site/2.6.0/rubygems.rb:138: warning: previous definition of GEM_DEP_FILES was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:141: warning: already initialized constant Gem::REPOSITORY_SUBDIRECTORIES
/Library/Ruby/Site/2.6.0/rubygems.rb:148: warning: previous definition of REPOSITORY_SUBDIRECTORIES was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:153: warning: already initialized constant Gem::REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES
/Library/Ruby/Site/2.6.0/rubygems.rb:161: warning: previous definition of REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:162: warning: already initialized constant Gem::READ_BINARY_ERRORS
/Library/Ruby/Site/2.6.0/rubygems.rb:169: warning: previous definition of READ_BINARY_ERRORS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:172: warning: already initialized constant Gem::WRITE_BINARY_ERRORS
/Library/Ruby/Site/2.6.0/rubygems.rb:174: warning: previous definition of WRITE_BINARY_ERRORS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:185: warning: already initialized constant Gem::LOADED_SPECS_MUTEX
/Library/Ruby/Site/2.6.0/rubygems.rb:181: warning: previous definition of LOADED_SPECS_MUTEX was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:1345: warning: already initialized constant Gem::MARSHAL_SPEC_DIR
/Library/Ruby/Site/2.6.0/rubygems.rb:1319: warning: previous definition of MARSHAL_SPEC_DIR was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/version.rb:157: warning: already initialized constant Gem::Version::VERSION_PATTERN
/Library/Ruby/Site/2.6.0/rubygems/version.rb:157: warning: previous definition of VERSION_PATTERN was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/version.rb:158: warning: already initialized constant Gem::Version::ANCHORED_VERSION_PATTERN
/Library/Ruby/Site/2.6.0/rubygems/version.rb:158: warning: previous definition of ANCHORED_VERSION_PATTERN was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:17: warning: already initialized constant Gem::Requirement::OPS
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:12: warning: previous definition of OPS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:27: warning: already initialized constant Gem::Requirement::SOURCE_SET_REQUIREMENT
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:22: warning: previous definition of SOURCE_SET_REQUIREMENT was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:30: warning: already initialized constant Gem::Requirement::PATTERN_RAW
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:25: warning: previous definition of PATTERN_RAW was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:35: warning: already initialized constant Gem::Requirement::PATTERN
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:30: warning: previous definition of PATTERN was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:40: warning: already initialized constant Gem::Requirement::DefaultRequirement
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:35: warning: previous definition of DefaultRequirement was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/requirement.rb:314: warning: already initialized constant Gem::Version::Requirement
/Library/Ruby/Site/2.6.0/rubygems/requirement.rb:311: warning: previous definition of Requirement was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/platform.rb:198: warning: already initialized constant Gem::Platform::RUBY
/Library/Ruby/Site/2.6.0/rubygems/platform.rb:204: warning: previous definition of RUBY was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/platform.rb:204: warning: already initialized constant Gem::Platform::CURRENT
/Library/Ruby/Site/2.6.0/rubygems/platform.rb:210: warning: previous definition of CURRENT was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/stub_specification.rb:9: warning: already initialized constant Gem::StubSpecification::PREFIX
/Library/Ruby/Site/2.6.0/rubygems/stub_specification.rb:9: warning: previous definition of PREFIX was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/stub_specification.rb:12: warning: already initialized constant Gem::StubSpecification::OPEN_MODE
/Library/Ruby/Site/2.6.0/rubygems/stub_specification.rb:12: warning: previous definition of OPEN_MODE was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/stub_specification.rb:18: warning: already initialized constant Gem::StubSpecification::StubLine::NO_EXTENSIONS
/Library/Ruby/Site/2.6.0/rubygems/stub_specification.rb:18: warning: previous definition of NO_EXTENSIONS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/stub_specification.rb:21: warning: already initialized constant Gem::StubSpecification::StubLine::REQUIRE_PATHS
/Library/Ruby/Site/2.6.0/rubygems/stub_specification.rb:21: warning: previous definition of REQUIRE_PATHS was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/stub_specification.rb:31: warning: already initialized constant Gem::StubSpecification::StubLine::REQUIRE_PATH_LIST
/Library/Ruby/Site/2.6.0/rubygems/stub_specification.rb:31: warning: previous definition of REQUIRE_PATH_LIST was here
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification_policy.rb:4:in `<top (required)>': superclass mismatch for class SpecificationPolicy (TypeError)
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:16:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:1365:in `<module:Gem>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:116:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /usr/local/Homebrew/Library/Homebrew/utils/gems.rb:47:in `setup_gem_environment!'
from /usr/local/Homebrew/Library/Homebrew/standalone/load_path.rb:13:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/startup.rb:6:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/startup.rb:6:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/global.rb:4:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/global.rb:4:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/build.rb:11:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/build.rb:11:in `<main>'
Error: Failure while executing; `/usr/bin/sandbox-exec -f /private/tmp/homebrew20221102-2820-wkxj9g.sb nice /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -W1 -- /usr/local/Homebrew/Library/Homebrew/build.rb /usr/local/Homebrew/Library/Taps/supabase/homebrew-tap/supabase.rb` exited with 1.
I noticed that this error also occurs when doing a brew upgrade on a different library, brew upgrade heroku.
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification_policy.rb:4:in `<top (required)>': superclass mismatch for class SpecificationPolicy (TypeError)
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:16:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:1365:in `<module:Gem>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:116:in `<top (required)>'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:85:in `require'
from /usr/local/Homebrew/Library/Homebrew/utils/gems.rb:47:in `setup_gem_environment!'
from /usr/local/Homebrew/Library/Homebrew/standalone/load_path.rb:13:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/startup.rb:6:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/startup.rb:6:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/global.rb:4:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/global.rb:4:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/build.rb:11:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/build.rb:11:in `<main>'
Error: Failure while executing; `/usr/bin/sandbox-exec -f /private/tmp/homebrew20221102-5824-12bp753.sb nice /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -W1 -- /usr/local/Homebrew/Library/Homebrew/build.rb /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew/Formula/heroku-node.rb` exited with 1.
I'm using rvm to manage my ruby versions and which ruby gives /Users/username/.rvm/rubies/ruby-3.0.0/bin/ruby. So not sure where the "Ruby.framework/Versions/2.6" in the error log is coming from.
Seems like an issue between Homebrew and ruby. May be related to the most recent xcode and MacOS Ventura updates (other reports of this error here and here)?
Anyone have any ideas or get past this issue?
I came across this, which suggested that to "clean up system Ruby properly", one could run:
sudo rm -rf \
/Library/Ruby/Gems/2.6.0/{build_info,cache,doc,extensions,gems} \
/Library/Ruby/Gems/2.6.0/specifications/*.gemspec \
/Library/Ruby/Site
I did this, re-ran the brew commands above, and the error was gone!
Not sure exactly what happened, maybe upgrading xcode and/or to MacOS Ventura messed with the system Ruby installation, which the above commands "clean up". It's also unclear why which ruby pointed to the updated ruby version installed by rvm, yet installing certain packages via Homebrew seemed to be invoking Mac's system Ruby (2.6.0). 🤷

Homebrew broken - "cannot load such file -- vendor/bundle/bundler/setup (LoadError)"

Every time I try to run a brew command, it gives the following error:
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- vendor/bundle/bundler/setup (LoadError)
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.7/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Homebrew/Library/Homebrew/load_path.rb:7:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/global.rb:8:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/global.rb:8:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:17:in `require_relative'
from /usr/local/Homebrew/Library/Homebrew/brew.rb:17:in `<main>'
I'm not sure if this is an issue with my Ruby/Bundler, since bundler works completely fine in other cases. What might the problem be?
brew update-reset && brew update worked for me.

Building ruby with rbenv and ruby-build fails with undefined symbol: SSLv2_method

I'm trying to install ruby 2.2.4 or 2.3.0 on my Synology DS215j which has an ARMv7 processor. I used optware-ng to install gcc, make, openssl, openssl-dev and zlib. I installed rbenv (version 1.0.0-19-g29b4da7) and the ruby-build plugin according to the instructions in the README.
These are the package and their versions installed with optware-ng
binutils - 2.25.1-1
gcc - 5.3.0-6
gconv-modules - 2.21-3
glibc-opt - 2.21-4
libc-dev - 2.21-1
libgmp - 6.0.0a-1
libmpc - 1.0.2-1
libmpfr - 3.1.3-1
libnsl - 2.21-3
libstdc++ - 6.0.21-6
make - 4.1-1
ncurses - 5.7-4
openssl - 1.0.2f-1
openssl-dev - 1.0.2f-1
readline - 6.1-2
ruby - 2.2.0-1
screen - 4.2.1-2
termcap - 1.3.1-3
zlib - 1.2.8-2
When I run rbenv install 2.2.4 or rbenv install 2.3.0 in both cases the build fails with the error message "undefined symbol: SSLv2_method". This is the error for the 2.2.4 build:
installing bundle gems: /var/services/homes/florian/.rbenv/versions/2.2.4/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
/tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require': /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/.ext/armv7l-linux-eabihf/openssl.so: undefined symbol: SSLv2_method - /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/.ext/armv7l-linux-eabihf/openssl.so (LoadError)
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/.ext/common/openssl.rb:17:in `<top (required)>'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/security.rb:11:in `<top (required)>'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/package.rb:43:in `<top (required)>'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/dependency_installer.rb:3:in `<top (required)>'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /tmp/ruby-build.20160329115213.2672/ruby-2.2.4/lib/rubygems.rb:556:in `install'
from ./tool/rbinstall.rb:722:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:721:in `each'
from ./tool/rbinstall.rb:721:in `block in <main>'
from ./tool/rbinstall.rb:757:in `call'
from ./tool/rbinstall.rb:757:in `block in <main>'
from ./tool/rbinstall.rb:754:in `each'
from ./tool/rbinstall.rb:754:in `<main>'
uncommon.mk:246: recipe for target 'do-install-all' failed
make: *** [do-install-all] Error 1
This seems to be related to something in rubygems.
Interestingly, the reason why I try to build ruby myself is, that the ruby version delivered with Synology 6 returns a similar error when I try to install gems:
florian#synology:~/.rbenv/plugins$ /usr/bin/gem install rails
ERROR: Loading command: install (LoadError)
/usr/lib/ruby/2.3.0/armle-linux-gnu/openssl.so: undefined symbol: SSLv2_method - /usr/lib/ruby/2.3.0/armle-linux-gnu/openssl.so
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
What could cause these issues and how could I resolve them?
When I run rbenv install 2.2.4 or rbenv install 2.3.0 in both cases the build fails with the error message "undefined symbol: SSLv2_method"...
What could cause these issues ...
The SSLv2 gear was completely removed from OpenSSL in March due to CVE-2016-0800 (DROWN Attack).
I think the complete removal was a bit harsh because of the effects like you are experiencing. There should have been a warning and transition period. And it should have occurred 10 years ago or so.
Instead of complete removal due to DROWN, I think SSLv2_method, SSLv2_client_method and SSLv2_server_method should have set an appropriate error code like ERR_R_REMOVED_INSECURE and returned NULL. <openssl/opensslconf.h> should have unconditionally set OPENSSL_NO_SSL2 also.
OpenSSL realized they broke ABI compatibility and added the symbols back to 1.0.2 with Commit 133138569f37d149. The check-in provided the symbols SSLv2_method, SSLv2_client_method and SSLv2_server_method again, but they return NULL without setting an error code. They also do not define OPENSSL_NO_SSL2. Also see [openssl.org #4398] BUG / 1.0.2g breaks CURL extension.
SSLv2 has been insecure for 15 or 20 years. Packages like Ruby should not have been referencing the symbols. You should file a security bug report against Ruby for referencing the symbol.
... and how could I resolve them?
To fix the issue, I believe you need either (1) wait for OpenSSL 1.0.2h, (2), manually patch OpenSSL 1.0.2g, or (3) remove all Ruby references to SSLv2_method, SSLv2_client_method and SSLv2_server_method.
Here's the patch you need for (2), manually patch OpenSSL 1.0.2g:
diff --git a/ssl/s2_meth.c b/ssl/s2_meth.c
index b312f17..d46e2f5 100644
--- a/ssl/s2_meth.c
+++ b/ssl/s2_meth.c
## -74,8 +74,8 ## IMPLEMENT_ssl2_meth_func(SSLv2_method,
ssl2_accept, ssl2_connect, ssl2_get_method)
#else /* !OPENSSL_NO_SSL2 */
-# if PEDANTIC
-static void *dummy = &dummy;
-# endif
+SSL_METHOD *SSLv2_method(void) { return NULL; }
+SSL_METHOD *SSLv2_client_method(void) { return NULL; }
+SSL_METHOD *SSLv2_server_method(void) { return NULL; }
#endif
You should also configure and compile OpenSSL with at least no-ssl2 no-ssl3 no-comp flags because they are known security problems. The configure options define OPENSSL_NO_SSL2, OPENSSL_NO_SSL3 and OPENSSL_NO_COMP in <openssl/opensslconf.h>.
After several attempts and lots of searching I found this ruby-build issue and reread the instructions in the ruby-build wiki which are suggesting for other platforms to install autoconf. I installed automaker, autoconf and gdbm (which I found some warnings in the ruby-build logs) with ipkg which didn't directly help. Only after I prefixed rbenv with RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt it worked.
For reference, these are the packages I have installed with ipkg
autoconf - 2.69-1
automake - 1.15-3
binutils - 2.25.1-1
gcc - 5.3.0-6
gconv-modules - 2.21-3
gdbm - 1.8.3-4
glibc-opt - 2.21-4
libc-dev - 2.21-1
libgmp - 6.0.0a-1
libmpc - 1.0.2-1
libmpfr - 3.1.3-1
libnsl - 2.21-3
libstdc++ - 6.0.21-6
m4 - 1.4.17-1
make - 4.1-1
ncurses - 5.7-4
openssl - 1.0.2f-1
openssl-dev - 1.0.2f-1
readline - 6.1-2
ruby - 2.2.0-1
screen - 4.2.1-2
termcap - 1.3.1-3
zlib - 1.2.8-2
This is the rbenv command which worked for me in the end
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt rbenv install 2.3.0 -v

gem install of pdf-extract on Macports / Mac OS X Yosemite

I am attempting to install pdf-extract on Mac OS X Yosemite. I assume it's better not to use the /usr/bin/ruby that comes with Yosemite, so I'm using the Macports version, /opt/local/bin/ruby (ver2.1.3).
The installation appears to go fine:
sudo port install ruby
sudo port install rb-rubygems
sudo port select --set ruby ruby21
which ruby #/opt/local/bin/ruby
which gem #/opt/local/bin/gem
sudo gem install pdf-extract
At the end of the last command, the message appears to indicate that all went well:
...
Done installing documentation for Ascii85, afm, commander, hashery, highline, libsvm-ruby-swig, mini_portile, nokogiri, pdf-core, pdf-extract, pdf-reader, prawn, ruby-rc4, sqlite3, ttfunk after 30 seconds
15 gems installed
However, when I attempt to run pdf-extract, I ran into the following error:
$ cd bin/
$ ./pdf-extract extract --titles journal.pdf
/opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:384:in `block in require_program': program version required (Commander::Runner::CommandError)
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `each'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:383:in `require_program'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/runner.rb:51:in `run!'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
from /opt/local/lib/ruby2.1/gems/2.1.0/gems/commander-4.2.1/lib/commander/import.rb:10:in `block in <top (required)>'
/private/tmp/pdfextract/lib/pdf/extract/references/score.rb:11:in `<module:Score>': uninitialized constant Libsvm::Model (NameError)
from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:4:in `<module:PdfExtract>'
from /private/tmp/pdfextract/lib/pdf/extract/references/score.rb:3:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `require_relative'
from /private/tmp/pdfextract/lib/pdf/extract/references/references.rb:3:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `require_relative'
from /private/tmp/pdfextract/lib/pdf/extract.rb:10:in `<top (required)>'
from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `require_relative'
from /private/tmp/pdfextract/lib/pdf-extract.rb:1:in `<top (required)>'
from ./pdf-extract:5:in `require_relative'
from ./pdf-extract:5:in `<main>'
My question is whether I've done the gem install correctly (and therefore it's probably a bug in pdf-extract) or whether I've messed up something in the installation (or in the file paths).
Side note: the installation folder was initially $HOME/Dropbox/code/ruby/pdf-extract, but I carried out a mv pdf-extract /tmp (to shorten the file paths in the error messages) and re-ran the install scripts (the error message essentially remained the same). I also tried replacing ./pdf-extract with /opt/local/bin/ruby2.1 pdf-extract but it did not help.

Resources