为什么此Rails应用程序无法部署到GCLOUD?

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

[使用命令尝试将非默认服务部署到gcloud应用程序时:

$ gcloud app deploy

我收到错误消息(在所有gem完成安装之后:]

...
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应用程序的任何额外步骤吗?

app.yaml

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>
ruby-on-rails google-app-engine gcloud app-engine-flexible
1个回答
0
投票

app.yaml删除以下行后,错误已修复,并且部署成功。

...
runtime_config:
  dotenv_config: flex-env-config
...

不知道为什么这句话首先很重要,请进一步研究并以更有意义的解释进行更新。

© www.soinside.com 2019 - 2024. All rights reserved.