使用 ruby 3.2 部署的 GCP App Engine Rails 应用程序向 foreman start 添加参数,然后失败

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

我正在使用 google cloud build 来部署我的 Rails 应用程序。最近我将 ruby 版本升级到了 3.2。我使用 foreman 作为 app.yaml 中的入口点(不带参数),并添加了我发现 ruby 3.2 所必需的 runtime_config (根据 Google 文档)。

这是app.yaml的代码片段:

runtime: ruby

entrypoint: bundle exec foreman start

env: flex

runtime_config:
  operating_system: "ubuntu22"

现在我收到以下错误:

Step #1: Step #2 - "build": === Ruby - Flex Entrypoint ([email protected]) ===
Step #1: Step #2 - "build": Using entrypoint bundle exec foreman start -o 0.0.0.0

Step #1: ERROR: (gcloud.app.deploy) Error Response: [9] An internal error occurred while processing task /app-engine-flex/flex_await_healthy/flex_await_healthy>2024-01-03T08:36:50.619Z16311.wm.1: ERROR: "foreman start" was called with arguments ["-o", "0.0.0.0"]
Step #1: Usage: "foreman start [PROCESS]"
Step #1: 
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/google.com/cloudsdktool/cloud-sdk" failed: step exited with non-zero status: 1

它以某种方式将参数“-o 0.0.0.0”添加到 foreman 启动命令中。

我不希望构建添加参数。 我尝试添加自己的论点,但结果是这样的:

Step #1: Step #2 - "build": === Ruby - Flex Entrypoint ([email protected]) ===
Step #1: Step #2 - "build": Using entrypoint bundle exec foreman start -m "web=1,worker=1" -o 0.0.0.0

使用 ruby 2.7 一切正常:

Step #1: Step #1: ## Command to start application.
Step #1: Step #1: CMD exec bundle exec foreman start

为什么 Google buildpack 添加此参数以及如何删除它?

ruby-on-rails google-app-engine
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.