App Engine Ruby flex环境app.yaml忽略了env_variables RAILS_ENV

我们使用GAE与Ruby灵活的环境,我们正在试图部署一个rails应用程序与阶段configuration(即RAILS_ENV = staging)。

根据https://cloud.google.com/appengine/docs/flexible/ruby/configuring-your-app-with-app-yaml,我们应该能够设置RAILS_ENVconfigurationapp.yaml的值:

env_variables: RAILS_ENV: 'staging' 

但是,当我们运行:

 gcloud app deploy 

生成一个(临时的)Dockerfile

 # Temporary. Will be moved to base image later. ENV RACK_ENV=production \ RAILS_ENV=production \ RAILS_SERVE_STATIC_FILES=true 

这会导致在PRODUCTION环境中进行部署(RAILS_ENV的默认值)。

这是一个错误还是我错过了什么?

这实际上看起来像是一个错误,因为总览文档指出,像RAILS_ENVNODE_ENV这样的variables被设置为“生产”。 这些实际上应该被视为可以在app.yaml重写的默认值。

我已经创build了一个缺陷报告,您可以在这里为更新添加星标:
https://code.google.com/p/google-cloud-sdk/issues/detail?id=1399

这绝对不应该发生,因为它与文档相矛盾。 这应该作为一个问题发布在灵活环境Ruby Docker镜像的github问题页面上 。