【问题标题】:I got this error when I publish my gem: "Could not find gem 'uix_validations (~> 0.5.0)' in any of the gem sources listed in your Gemfile."当我发布我的 gem 时出现此错误:“在 Gemfile 中列出的任何 gem 源中找不到 gem 'uix_validations (~> 0.5.0)'。”
【发布时间】:2018-09-16 19:37:08
【问题描述】:

我刚刚在 ruby​​gems.org here is the link 上发布了我的 gem。一切看起来都不错。

但是当我尝试使用 gem 'uix_validations', '~> 0.5.0' 添加到项目时,我在安装包时收到此错误:

Could not find gem 'uix_validations (~> 0.5.0)' in any of the gem sources listed
in your Gemfile

我不知道如何解决这个问题。

我使用以下步骤发布:

gem build uix_validations.gemspec

这会生成一个文件:uix_validations-0.5.0.gem

并发布:

gem push uix_validations-0.5.0.gem

【问题讨论】:

    标签: ruby-on-rails ruby rubygems


    【解决方案1】:

    我在这里得到了答案:github rubygems

    “您的 gem 已经发布,但您需要等待 RubyGems.org 刷新它的缓存。应该只需要很短的时间。”

    作者:colby-swandale

    【讨论】:

      【解决方案2】:

      您的 Gemfile 中可能没有正确的来源。

      在您指定 gem 之前,您应该定义 ruby​​gems 的来源。这通常在第一行完成。

      例子

      source 'https://rubygems.org'
      
      gem 'uix_validations'
      

      【讨论】:

      • @LucasAndrade 您能否在问题中包含您的 gemfile 的内容?
      猜你喜欢
      • 2018-04-02
      • 2018-08-12
      • 2012-02-11
      • 2017-07-14
      • 2011-04-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多