【问题标题】:bundler installs the country_select gem from the wrong sourcebundler 从错误的来源安装 country_select gem
【发布时间】:2013-07-08 07:08:13
【问题描述】:

在我的 Rail 3.2.13 gemfile 中,我添加了 country_select gem

gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git'

运行 bundle install 但是会加载错误版本的 gem。相反,它会在 https://github.com/rails/country_select 处加载过时的存储库

这发生在我的开发环境以及将我的应用部署到 Heroku 时。

我能够在我的开发环境中通过使用 ruby​​ gem specific_install 来克服这个问题,但这对 heroku 没有帮助。

有什么想法吗?

【问题讨论】:

  • 你的 gemfile.lock 中的版本是什么?
  • country_select (1.2.0) - 最新版本
  • 是来自这个 git 源 'git://github.com/stefanpenner/country_select.git' 还是另一个?
  • GIT 远程:git://github.com/stefanpenner/country_select.git 修订:be3618c7c6c9b4a37dea736404b78917fd5ff748 规格:country_select (1.2.0)

标签: ruby-on-rails heroku bundler


【解决方案1】:

您必须使用 git 路径更新您的 Gemfile.lock:

bundle update country_select

它应该可以解决问题。

【讨论】:

    【解决方案2】:

    您可以使用以下命令在远程 git 存储库上设置要使用的分支:

    gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git', branch: 'master'
    

    或事件提交标签:

    gem 'country_select', :git => 'git://github.com/stefanpenner/country_select.git', revision: 'commit_tag_here'
    

    此外,在生产环境中运行时,一个好的做法是修复您的 gem 版本以避免不必要的 gem 更新。

    【讨论】:

      猜你喜欢
      • 2011-05-07
      • 2011-03-28
      • 2014-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-20
      相关资源
      最近更新 更多