【问题标题】:Install local gems via bundle on heroku not working在heroku上通过捆绑安装本地gem不起作用
【发布时间】:2019-03-15 07:42:26
【问题描述】:

我正在尝试将我的应用安装到 heroku。但我对宝石有疑问。它是一个私有 gem,我们没有私有 gem 服务器设置,所以我在本地将 gem 克隆为应用程序内的子模块。

当我推送到 heroku 时,我收到了这个错误:

 !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.

        Detected buildpacks: Ruby,Node.js

        See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order

-----> Ruby app detected

-----> Compiling Ruby/Rails

-----> Using Ruby version: ruby-2.5.1

-----> Installing dependencies using bundler 1.15.2

   Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment

   Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.

   You are trying to install in deployment mode after changing

   your Gemfile. Run `bundle install` elsewhere and add the

   updated Gemfile.lock to version control.



   The gemspecs for path gems changed

   Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.

   You are trying to install in deployment mode after changing

   your Gemfile. Run `bundle install` elsewhere and add the

   updated Gemfile.lock to version control.



   The gemspecs for path gems changed

 !

 !     Failed to install gems via Bundler.

 !

 !     Push rejected, failed to compile Ruby app.

 !     Push failed

当我删除本地安装 gem 时,一切正常。

如此强烈的预感是,bundler 1.15.2 以不同的方式处理本地 gem,这会导致冲突。

在我的 Gemfile 中,而不是在任何组中,我有 gem 'portkey', path: './gems/portkey/'

我的 Gemfile.lock 顶部有

PATH
  remote: gems/portkey
  specs:
    portkey (0.1.10)
      bitly
      omniauth-google-oauth2 (~> 0.5.3)
      rails (~> 5.2.1)
      rebrandly
      shortener (~> 0.8.0)
      will_paginate

Heroku 尚不支持 bundler 1.16.2 不支持

我正在使用 rails 5/ruby-2.5,我似乎无法将 bundler 降级到 1.15.2 并生成旧版本的锁定文件

我无法通过其他任何方式轻松访问此宝石。

我不知道如何才能使这个 gem 的安装工作,我们将不胜感激。

【问题讨论】:

    标签: ruby-on-rails heroku rubygems bundler


    【解决方案1】:

    有一个类似的问题,通过升级到 Bundler 2.0.1(现在 Heroku 支持)解决了。

    对于 1.x 版本,他们仍然使用 1.15.2。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-30
      • 2016-11-19
      • 2012-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多