繁体   English   中英

为什么这个 Rails 应用无法部署到 GCLOUD?

[英]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 应用程序的额外步骤?

应用程序.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>

app.yaml删除此行后,错误得到修复并部署成功:

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

首先不确定为什么这条线很重要,请进一步调查并更新更有意义的解释。

暂无
暂无

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

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