繁体   English   中英

由于 ruby-buildpack + bundler,部署到 dokku 失败?

[英]Deploy to dokku fails because of ruby-buildpack + bundler?

我正在将 Rails 应用程序部署到 dokku。 版本是:

  • ruby 3.1.2
  • bundler 2.3.26(在我的开发机器上)
  • gem 3.3.22(在我的开发机器上)

当我尝试部署到 dokku 时,使用了 heroku ruby buildpack,我得到以下 output:

-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       [330, #<Thread:0x00007fc0e8b43c90 run>, #<NameError: uninitialized constant Gem::Source
       (defined?(@source) && @source) || Gem::Source::Installed.new
       ^

疯狂的事情:我有另一个具有相同配置的应用程序:

-----> Ruby app detected
-----> Installing bundler 2.2.21
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.2.21
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Fetching gem metadata from https://rubygems.org/.........

到目前为止我的研究:

这似乎是这里描述的问题,作为 2022 年 2 月首次描述的 bundler 2.3.7 的问题。但是我的 buildpack 使用 bundler 2.2.21,所以它应该不会受到影响?

来自 heroku 的最新 ruby-buildpack似乎已经在 2021 年发布了? 这是对的吗?

这解决了一个应用程序的问题:

  • 升级到 ruby 3.1.3(通过在Gemfile.ruby-version中编辑 ruby 版本)
  • 捆绑安装
  • 捆绑锁 --add-platform x86_64-linux

一次成功安装后,我还可以在升级之前回滚到旧的 ruby 版本,并成功安装它。

如何? 为什么? 这里发生了什么?

现在另一个曾经工作的应用程序停止工作。

清除 dokku 构建缓存解决了这个问题:

dokku repo:purge-cache

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM