【问题标题】:Can't run bundle update on Windows无法在 Windows 上运行捆绑更新
【发布时间】:2013-11-13 20:00:23
【问题描述】:

每当我在 Windows 8.1 上运行捆绑更新或捆绑安装时,我都无法从 github 更新/安装 gem。我可以安装其他 gem,例如 uglifier,但它不适用于 github gem。例如,把它放在 Gemfile 中

group :development, :test do
  gem 'rspec-rails', '2.13.1'
  gem 'spork-rails', github: 'sporkrb/spork-rails'
end

导致错误:

Retrying source fetch due to error (2/3): You need to install git to be able to use gems from git repositories.

问题是我肯定安装了 git。我从 Git Bash 运行它,并在一个我正在克隆、拉取和使用 Git 的项目中工作。那么为什么捆绑更新/安装一直坚持说我没有安装 git?如何修复它并使捆绑安装工作?

【问题讨论】:

    标签: ruby-on-rails ruby git gem bundle


    【解决方案1】:

    您是否正在运行 Bundler 的预发布版本? This commit 可能与您的问题有关;它看起来像早期版本的 Bundler scan your %PATH% 用于“git”,而不是“git.exe”。

    最简单的解决方案是将捆绑程序反向移植到 1.3.5:

    gem uninstall bundler
    gem install bundler
    

    【讨论】:

      【解决方案2】:

      安装 Git 时不要忘记选择单选“从 Windows 命令提示符使用 git”。这就是关键! 默认设置为“仅使用 Git Bash 中的 git”。

      【讨论】:

        【解决方案3】:

        对我来说,它也是路径,带有空格和重音,我想这就是重音的问题。安装了 bundler 1.6-pre,卸载了 git,在 C:\Git 中重新安装,在我的 IDE (RubyMine) 中更改了 git 的路径,最后使用 bundle install 安装了每个 gem。

        非常感谢!

        【讨论】:

          【解决方案4】:

          在 Windows 上,如果您在安装 git 后仍然遇到该错误,请确保关闭“CMD”实例并再次打开它,系统路径变量已设置,但未在活动的“CMD”中实例化' 窗口。

          【讨论】:

            猜你喜欢
            • 2015-07-28
            • 1970-01-01
            • 2018-12-09
            • 1970-01-01
            • 1970-01-01
            • 2013-07-02
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多