Missing dependency on ruby-erb

Description:

Attempting to run msfconsole without manually installing ruby-erb fails with the following error:

Output of `msfconsole`
<internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require': cannot load such file -- erb (LoadError)
Did you mean?  drb
               irb
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpservlet/erbhandler.rb:14:in `<top (required)>'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpservlet.rb:15:in `require_relative'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpservlet.rb:15:in `<top (required)>'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:18:in `require_relative'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick/httpserver.rb:18:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/webrick-1.8.1/lib/webrick.rb:230:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/metasploit_data_models-6.0.3/lib/metasploit_data_models.rb:6:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/metasploit-credential-6.0.9/lib/metasploit/credential.rb:11:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/lib/metasploit/framework.rb:12:in `<top (required)>'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:73:in `require'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:73:in `rescue in block in require'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:51:in `block in require'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:44:in `each'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:44:in `require'
        from /usr/lib/ruby/3.2.0/bundler.rb:207:in `require'
        from /opt/metasploit/config/application.rb:13:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/config/environment.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/lib/msfenv.rb:28:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/msfconsole:21:in `<main>'
/usr/lib/ruby/3.2.0/bundler/runtime.rb:60:in `require': cannot load such file -- metasploit-framework (LoadError)
Did you mean?  metasploit/framework
               metasploit/framework/api
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:60:in `block (2 levels) in require'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:55:in `each'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:55:in `block in require'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:44:in `each'
        from /usr/lib/ruby/3.2.0/bundler/runtime.rb:44:in `require'
        from /usr/lib/ruby/3.2.0/bundler.rb:207:in `require'
        from /opt/metasploit/config/application.rb:13:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/config/environment.rb:2:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/lib/msfenv.rb:28:in `<top (required)>'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
        from /opt/metasploit/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /opt/metasploit/msfconsole:21:in `<main>'

This should be fixed by adding ruby-erb to the depends array.

Additional info:

  • package version(s): 6.4.24-1
  • config and/or log files:
  • link to upstream bug report, if any:

Steps to reproduce:

  1. Install metasploit but not ruby-erb
  2. Attempt to run msfconsole