We are using GAE with Ruby flexible environment, and we're trying to deploy a rails app with staging configurations (i.e. RAILS_ENV=staging).

According to https://cloud.google.com/appengine/docs/flexible/ruby/configuring-your-app-with-app-yaml we should be able to set the value of RAILS_ENV configuring an app.yaml with:

  RAILS_ENV: 'staging'

However, when we run:

gcloud app deploy

A (temporary) Dockerfile is generated with

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

Which results in a deployment in the PRODUCTION environment (default value for RAILS_ENV).

Is this a bug or am I missing something?


This actually looks like a misfeature, as the overview documentation states that variables like RAILS_ENV and NODE_ENV get set to 'production' on purpose. These should actually be treated as default values which can be overridden in app.yaml.

I've created a defect report which you can star for updates here:


This is definitely something that shouldn't happen, since it contradicts the docs. This should be posted as an issue on the github issue page for the Flexible Environment Ruby Docker image.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.