Metasploit - InstallError: metasploit_data_models requires Ruby version >= 2.1

文章详细介绍了如何解决在使用Metasploit框架时遇到的Ruby版本不匹配导致的安装错误,包括从环境配置到具体操作步骤的全面指导。

After command ‘git pull’, metasploit cann’t start with errors.

[nixawk@core metasploit-framework]$ ./msfconsole
Could not find metasploit_data_models-0.23.0 in any of the sources
Run `bundle install` to install missing gems. 
[nixawk@core metasploit-framework]$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...                     
Using rake 10.4.2                             
Using i18n 0.6.11                             
Using multi_json 1.0.4                        
....                                          
Gem::InstallError: metasploit_data_models requires Ruby version >= 2.1.
An error occurred while installing metasploit_data_models (0.23.0), and Bundler cannot continue.
Make sure that `gem install metasploit_data_models -v '0.23.0'` succeeds before bundling.

[nixawk@core metasploit-framework]$ gem install metasploit_data_models -v '0.23.0'
ERROR:  Error installing metasploit_data_models:
        metasploit_data_models requires Ruby version >= 2.1.

Solutions:

[nixawk@core metasploit-framework]$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
[nixawk@core metasploit-framework]$ source ~/.rvm/scripts/rvm 
[nixawk@core metasploit-framework]$ rvm list 
Warning! PATH is not properly set up, '/home/notfound/.rvm/gems/ruby-1.9.3-p551/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p551'.

rvm rubies                                   

=> ruby-1.9.3-p551 [ x86_64 ]                
 * ruby-2.1.5 [ x86_64 ]                     

# => - current                               
# =* - current && default                    
#  * - default                               

[nixawk@core metasploit-framework]$ rvm use ruby-2.1.5
Warning! PATH is not properly set up, '/home/notfound/.rvm/gems/ruby-1.9.3-p551/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p551'.
Using /home/notfound/.rvm/gems/ruby-2.1.5    
[nixawk@core metasploit-framework]$ msfconsole

[1].https://rvm.io/rvm/basics
[2].https://github.com/rapid7/metasploit-framework/wiki/Setting-Up-a-Metasploit-Development-Environment

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值