在heroku上通过bundle安装本地gem不起作用

问题描述 投票:2回答:1

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

当我推送到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

当我删除本地安装的宝石时,一切正常。

如此强烈的预感是捆绑器1.15.2以不同的方式处理本地宝石并且它引起了冲突。

在我的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不支持捆绑器1.16.2但尚未支持

我正在使用rails 5 / ruby​​-2.5,我似乎无法将bundler降级到1.15.2并生成一个旧版本的lockfile

我不能轻易地以任何其他方式使这个宝石可以访问。

我很难过如何安装这个宝石工作,我们将非常感谢您的建议。

ruby-on-rails heroku rubygems bundler
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.