ruby - 强制 bundle 安装使用 https ://instead of git://for GitHub-based gems

标签 ruby github bundler

我正在尝试构建一个 Rails 项目,因为我正在使用的主机无法访问 Internet 的 git://协议(protocol)(端口 9418),我收到如下错误

Fetching git://github.com/pivotal/jasmine.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.130]: errno=Connection refused

运行 bundle install 时。

GemFile 中的相关行没有指定 git://作为协议(protocol),它只是指向 GitHub 作为 gem 的源

gem 'jasmine', :github => 'pivotal/jasmine-gem'

我需要做什么才能使 bundler 使用 https://而不是 git://从 GitHub 拉取 gems?

编辑:

除了编辑 GemFile 中每个受影响的行之外,还有其他方法吗?如果项目的 GemFile 已更新,我宁愿避免任何合并问题。

最佳答案

使用bundle config github.https true

关于ruby - 强制 bundle 安装使用 https ://instead of git://for GitHub-based gems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21260689/

相关文章:

plugins - Jekyll 插件不工作

ruby - 获取 Rails 项目中包含的所有 gem 的变更日志

javascript - Parcel-Bundler 无法修复高漏洞

javascript - 获取哈希值 Rails/Chart.JS

ruby - 如何测量 cucumber 步骤的执行时间

git - 尝试签署提交 (GPG) 时,IntelliJ 无法提交更改

github - 将拉取请求标记为准备好审查

ruby-on-rails - 安装 pg (1.2.1) 时出错,Bundler 无法继续

ruby-on-rails - 您如何从 ruby​​ on rails 中的 Controller 引用另一个类?

ruby - 退出注册机的正确方式是什么?