【问题标题】:Find gem remote source查找 gem 远程源
【发布时间】:2017-10-09 09:02:15
【问题描述】:

我可以通过

找到gem的本地安装路径
> gem which oauth
/Users/xxjjnn/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/oauth-0.4.7/lib/oauth.rb

当使用 Bundler 时,您可以指定 git repo 的来源:

gem 'deadlock_retry', git: "https://github.com/mperham/deadlock_retry.git"

但是,gemfile 中的许多 gem 没有指定 git 源。例如,在 github 中搜索“oauth”时,返回了许多分支。如果 Gemfile 没有指定来源,如何推断安装它的 URI 是什么?

这些工作都没有:

gem specification oauth | grep github
bundle install | grep oauth

【问题讨论】:

    标签: github rubygems


    【解决方案1】:

    如果源未在特定 gem 中指定,则它来自 Gemfile 中指定的源。在 Gemfile 的顶部,您会看到如下内容:

    source "https://rubygems.org"
    

    【讨论】:

    • 啊哈,搜索 ruby​​gems 总是只返回一个结果
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-05
    • 2013-02-22
    • 1970-01-01
    • 1970-01-01
    • 2011-09-25
    • 1970-01-01
    相关资源
    最近更新 更多