简体   繁体   中英

Why does this Rails app fails to deploy to GCLOUD?

While attempting to deploy a non-default service to gcloud application with the command:

$ gcloud app deploy

I get the error (right after all gems finish installing):

...
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

Note that I performed this process for another service (default) minutes before this one, which tells me my local configuration is working to some extent. Could I be missing any extra step specific to a Rails Application ?

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>

The error got fixed and deployment succeeded when removed this lines from app.yaml :

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

Not sure why this lines were important in the first place, investigate further and update with more meaningful explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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