a year ago
I'm new to deploying stuff and wanted to deploy a small Rails app from my GitHub repo. Sadly it crashed because: "ArgumentError: Missing secret_key_base for 'production' environment, set this string with bin/rails credentials:edit (ArgumentError)"
I set it as variable in environment in Railway, but it didn't fix the issue. I deployed that same app on Render, and it works right away. Any ideas?
Here it says it should work from environment variable: https://blog.saeloun.com/2023/08/11/rails-7-1-store-secret-key-base-in-rails-config/
12 Replies
Ok it seems to have been fixed by using RAILSMASTERKEY instead. But as deployment succeeded, I have issue with running the website. It says 502 bad gateway when go to my domain.
My deploy command is bin/rails db:setup && bin/rails server -p 8080, and these are logs:
I don't see commands run on deploy, is there a way to see them? Maybe error occurred before reaching rails server.
Well I moved some of the commands to build, and I'm very confused, I don't know if my build command is running at all. Deploy cans tart rails s, but I don't see any errors for rails db:setup even tho it seems to crush my app.
Ohhh it was using Dockerfile commands only. Wow im new to this hah, im sorry for messy question.
The solution was to add this to the end of Gemfile. No idea why, but now process booting works.
CMD rm -f tmp/pids/[server.pid](server.pid) && ./bin/rails server -p 8080
a year ago
Glad to see you figured this out! Marking as solved
a year ago
!s
Status changed to Solved adam • 11 months ago