Connecting to the rails console with railway CLI
I'm using the Planetscale database (MySQL). Since moving to nix packs from Heroku buildpacks, I had to add some additional changes to the project, including some dependencies.
Whilst the project itself builds and runs fine, I'm unable to boot up the Rails console due to an SSL error.
In the database.yml I use the following:
The SSL Mode is verify_idenity and loads the CA.
I'm wondering if there's some issue using the CA file when executing the railway run command?
7 Replies
oo, I think i have a solution
on macOS the ca is in a different location
I've changed database.yml to include a ENV variable for the path, and I think if I try run
Is there a way to execute with some environment variables set?
ok!
I fixed this:!!!
so this is needed to run locally on macOS
You could add this to railway itself then use railway run as your local runner
railway run rails c
Thanks Jake!
How do I add this to railway itself?
SSL_CA_PATH="/etc/ssl/cert.pem"
Slam that into Variables for your service!
And, if it's different for each person, you can change it across environments π
Ohh! Yes it will be different depending on the OS the person uses I think
mhm. Hence why we have those environments
is it expected that rails console does not have shared variables exposed? for example, I am sharing postgres shared variables, getting into console and they're empty. The app works fine tho otherwise.