【问题标题】:no such file to load -- bundler (LoadError)没有要加载的文件--bundler (LoadError)
【发布时间】:2013-12-14 01:00:50
【问题描述】:

所以我在虚拟机中运行回溯 5。我正在尝试更新 metasploit。我从 github 下载了 metasploit 目录,并完全按照网络告诉我的方式删除了旧的 svn 目录(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 命令来“bundle update”和“bundle install”。附带说明一下,当您运行“捆绑更新”时也会导致错误:

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 时遇到了问题,此时我想我不妨问问互联网,让真正知道这里发生了什么的人来帮忙。

【问题讨论】:

    标签: ruby-on-rails ruby bundler metasploit


    【解决方案1】:

    一切都正确,因为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 版本绝对不是处理的最佳选择。

    【讨论】:

    • 此外,1.9.2 不再受支持,并且包含已知的安全漏洞。您应该更新到 1.9.3p484 或更高版本。
    猜你喜欢
    • 1970-01-01
    • 2014-01-16
    • 2011-02-23
    • 2011-12-19
    • 2011-10-24
    • 2011-11-30
    • 2016-05-09
    • 2023-03-03
    相关资源
    最近更新 更多