gpt4 book ai didi

ruby-on-rails - 通过 bundle 在 heroku 上安装本地 gem 不起作用

转载 作者:行者123 更新时间:2023-12-05 07:29:28 26 4
gpt4 key购买 nike

我正在尝试将我的应用程序安装到 heroku。但我对 gem 有疑问。它是私有(private) gem,我们没有私有(private) 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。

我对如何安装这个 gem 感到困惑,非常感谢您的建议。

最佳答案

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

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

关于ruby-on-rails - 通过 bundle 在 heroku 上安装本地 gem 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52739478/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com