![](/img/trans.png)
[英]gcloud app deploy fails on ruby-build for both 2.4.2 and 2.5.1
[英]Why does this Rails app fails to deploy to GCLOUD?
嘗試使用以下命令將非默認服務部署到 gcloud 應用程序時:
$ gcloud app deploy
我收到錯誤(在所有 gems 安裝完成后):
...
Step #1: /opt/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/google-api-client-
0.36.4/lib/google/apis/core/http_command.rb:228:in `check_status': forbidden: The caller does
not have permission (Google::Apis::ClientError)
....
Step #1: from /opt/rbenv/versions/2.4.1/bin/rcloadenv:22:in `<main>'
Step #1: The command '/bin/sh -c gem install rcloadenv && rbenv rehash && rcloadenv flex-env-
config >> .env' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/cloud-
builders/docker@sha256:853164af9dfd5ea4613401df48ad77b61bcb2c101b4e5de261c8300ecdd6eb47"
failed: exit status 1
請注意,我在此之前的幾分鍾內為另一項服務(默認)執行了此過程,這告訴我我的本地配置在某種程度上是有效的。 我是否會遺漏任何特定於 Rails 應用程序的額外步驟?
entrypoint: bundle exec rackup --port $PORT
env: flex
runtime: ruby
service: api
runtime_config:
dotenv_config: flex-env-config
automatic_scaling:
min_instances: 0
min_idle_instances: 0
env_variables:
SECRET_KEY_BASE: <redacted-key>
beta_settings:
cloud_sql_instances: <redacted-instance-info>
從app.yaml
刪除此行后,錯誤得到修復並部署成功:
...
runtime_config:
dotenv_config: flex-env-config
...
首先不確定為什么這條線很重要,請進一步調查並更新更有意義的解釋。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.