Bug running Dockerized Rails 5 apps

My Dockerized Rails 5 app build failed with the following error:

rake aborted!
NoMethodError: undefined method `split' for nil:NilClass
/home/ubuntu/my-app-name/config/application.rb:57:in `<class:Application>'

It failed because the environment variable ACTION_CABLE_ALLOWED_REQUEST_ORIGINS was apparently nil, even though I specified it in my Dockerfile, as follows:

RUN bundle exec rake RAILS_ENV=production DATABASE_URL=postgresql://user:pass@ ACTION_CABLE_ALLOWED_REQUEST_ORIGINS=foo,bar SECRET_TOKEN=dummytoken assets:precompile
# Provide a dummy DATABASE_URL and more to Rails so it can pre-compile
# assets. The values do not need to be real, just valid syntax.

So um, yeah… dead in the water. Please advise.

No reply, huh? Impressive.

Hi Caleb,

Discuss is a place for our customers to talk about problems and solutions in a mutual environment. There is no guarantee of an answer. We try to respond to issues on these forums, but our paying customers are our priority.

For your particular issue, this does not appear to be related to CircleCI. I suggest trying to reproduce the issue in a local docker environment and debug it from there.

The build works great locally. Thanks for the awesome support.