ruby-on-rails – 没有要加载的文件 – bundler(LoadError)

所以我在虚拟机中运行backtrack 5.我正在尝试更新metasploit.我从github下载了metasploit目录并删除了旧的svn目录,就像web告诉我的那样(https://community.rapid7.com/community/metasploit/blog/2013/05/20/git-clone-metasploit-dont-svn-checkout).运行msfupdate时出现此错误:

root@bt:~/metasploit# ./msfupdate
[*]
[*] Attempting to update the Metasploit Framework...
[*]

[*] Checking for updates via git
[*] Note: Updating from bleeding edge
HEAD is now at a02e0ee Land #2682 - Kimai v0.9.2 'db_restore.php' SQL Injection
Already on 'master'
Already up-to-date.
[*] Updating gems...
./msfupdate:188:in `require': no such file to load -- bundler (LoadError)
    from ./msfupdate:188:in `update_git!'
    from ./msfupdate:137:in `block in run!'
    from ./msfupdate:135:in `chdir'
    from ./msfupdate:135:in `run!'
    from ./msfupdate:292:in `<main>'

我知道我可以运行bundle命令来“捆绑更新”和“捆绑安装”.在旁注中,当您运行“捆绑更新”时,这也会导致错误:

Gem::InstallError: factory_girl requires Ruby version >= 1.9.2.

考虑到当我要求Ruby的版本时我得到这个,这很奇怪:

root@bt:~/metasploit# ruby -v
ruby 1.9.2dev (2010-07-02) [x86_64-linux]

这不是最新版本,但是我在更新Ruby时遇到了麻烦,而且我觉得我不妨问互联网,并且有人真正知道这里发生了什么事情来帮忙.

最佳答案
一切都是正确的,因为1.9.2dev版本优于1.9.2:

irb > Gem::Version.new('1.9.2dev') >= Gem::Version.new('1.9.2')
# => false
irb > Gem::Version.new('1.9.2dev') >= Gem::Version.new('1.9.1')
# => true

作为临时解决方法,您可以尝试显式安装bundler:

gem install bundler

显然我建议你在任何情况下升级Ruby,dev版本绝对不是最好的选择.

转载注明原文:ruby-on-rails – 没有要加载的文件 – bundler(LoadError) - 代码日志