Rails Solid Cache - missing secret key base
nazisagit
HOBBYOP

5 months ago

ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError)
          raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"

I am deploying my rails 8 application. It is built using a Dockerfile. I have solid cache installed, during build time it is unable to find the secret_key_base. However, I ssh'd into the code base and I checked the production yaml and the secret key base is indeed there. I have also added the RAILS_MASTER_KEY variable to my environment and set it to the production key value. I suspect it may be due to my Dockerfile, however I cannot be sure.

Solved

4 Replies

jake
EMPLOYEE

5 months ago

Did you add ARG in your Dockerfile so it's available at the application layer?


Status changed to Awaiting User Response Railway 5 months ago


nazisagit
HOBBYOP

5 months ago

I did not actually. Is this how it needs to be set?

```

ARG RAILS_MASTER_KEY=$RAILS_MASTER_KEY
```


jake

Did you add ARG in your Dockerfile so it's available at the application layer?

nazisagit
HOBBYOP

5 months ago

I did not actually. Is this how it needs to be set?

```

ARG RAILS_MASTER_KEY=$RAILS_MASTER_KEY
```


nazisagit
HOBBYOP

5 months ago

Closing this thread as I don't need it anymore


Status changed to Solved nazisagit 5 months ago


Loading...