metasploit更新后msfconsole报错的解决方法

2025-10-27 04:04:19

1、首先更新apt程序库

apt update

metasploit更新后msfconsole报错的解决方法

2、更新metasploit 框架

apt install metasploit-framework

metasploit更新后msfconsole报错的解决方法

3、运行msfconsole发现报错了,报错信息为

/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated

Could not find io-console-0.5.6 in any of the sources

Run `bundle install` to install missing gems

提示需要执行bundle install

metasploit更新后msfconsole报错的解决方法

4、安装的bundler版本需要大于等于Gemfile.lock中要求的版本

cd /usr/share/metasploit-framework/

cat Gemfile.lock | grep -A 1 "BUNDLED"

5、进行gem更新

gem update --system

metasploit更新后msfconsole报错的解决方法

6、安装对应版本的bundler

gem install bundler -v 2.1.4

metasploit更新后msfconsole报错的解决方法

7、经过测试需要安装这些依赖

apt-get install ruby-dev

apt-get install postgresql

apt-get install libpcap-dev

apt-get install oracle*

apt-get install libsqlite3-dev

metasploit更新后msfconsole报错的解决方法

8、进入metasploit目录,执行bundle install 安装

cd /usr/share/metasploit-framework/

bundle install

metasploit更新后msfconsole报错的解决方法

metasploit更新后msfconsole报错的解决方法

9、执行msfconsole成功启动,但会出现下面警告提示。

/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated

metasploit更新后msfconsole报错的解决方法

10、通过下面方式可以解决警告提示的问题。

sed -i "s#Gem::ConfigMap\[:arch\]#RbConfig::CONFIG\['arch'\]#g;s#Gem::ConfigMap\[:ruby_version\]#RbConfig::CONFIG\['ruby_version'\]#g" /usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb

metasploit更新后msfconsole报错的解决方法

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢