我正在尝试将我的应用程序安装到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_paginateHeroku还不支持bundler 1.16.2 afaik
我使用的是Rails5/ruby-2.5,我似乎无法将bundler降级到1.15.2并生成旧版本的锁文件
我不能轻易地让这个宝石以其他方式访问。
我对如何让这个gem的安装工作感到困惑,并将非常感谢您的建议。
发布于 2019-02-26 08:06:39
有类似的问题,通过升级到Bundler 2.0.1 (现在由Heroku支持)解决了。
不过,对于1.x版本,他们仍然使用1.15.2。
https://stackoverflow.com/questions/52739478
复制相似问题