bobrock Posted January 31 Posted January 31 I have a Rails app running at https://bobrock.heliohost.us/home that does just fine in development mode. But when I switch to production mode the site will no longer load. Of course, in production mode, I can't see whatever error is causing the problem. On my local machine, I can switch between development and production without any problems, but I had to add config.hosts << "localhost" to the `production.rb` local environment file to make it work. I added config.hosts << "bobrock.heliohost.us" to the `production.rb` remote environment file, but that didn't clear the error. What else should I try to get things running in production mode?
wolstech Posted January 31 Posted January 31 This is a Krydos question. Basically nobody else uses RoR, support for it is rather new, and there is no log available on your end if you set it to production.
Krydos Posted January 31 Posted January 31 Here's your error on production App 3001142 output: Error: The application encountered the following error: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError) Maybe this will help? https://stackoverflow.com/a/51467308
bobrock Posted January 31 Author Posted January 31 Thanks, Krydos! That was exactly the clue I needed. It turned out that my site was missing the `master.key` file, which, of course, was not uploaded as part of my GitHub repo because it's not there for security. Once I manually uploaded that file the site appears to be working now in production mode. 1
Krydos Posted January 31 Posted January 31 Glad you got it working. Let us know if you need help with anything else.
Recommended Posts