通过捆绑在heroku上安装本地gem不能正常工作

时间:2018-10-10 11:43:00

标签: ruby-on-rails heroku rubygems bundler

我正在尝试将我的应用安装到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时,一切正常。

如此强烈的预感是,捆绑程序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,但似乎无法将捆绑程序降级到1.15.2并生成较旧版本的锁文件

我无法轻易以其他任何方式访问此宝石。

我很困惑如何安装此gem,建议将不胜感激。

1 个答案:

答案 0 :(得分:0)

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

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