I'm wondering if there is a way to generate a Rails SECRET_KEY_BASE variable without having Ruby installed? All answers on SO I've seen point to using the SecureRandom library in Ruby.
This is fine, but my situation is a bit chicken and egg - I want to generate a file with a SECRET_KEY_BASE before I've built a Docker image with my Rails app. The base VM that the container runs in doesn't have Ruby installed.
It's Ubuntu 16.04 server and I'd install as little extra as possible (preferably just Docker!). It has Perl and OpenSSL installed. Could any of these be used?
OK, I found out - using OpenSSL:
openssl rand -hex 64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With