Checklist for Rails First Deploy
- RAILS_MASTER_KEY https://hatchbox.relationkit.io/articles/50-i-m-getting-an-error-activesupport-messageencryptor-inval
- rails db:encryption:init
- EDITOR=”cursor –wait” bin/rails credentials:edit –environment=production
-
commit config/credentials/production.yml.enc
- config.public_file_server.enabled = true # ENV[‘RAILS_SERVE_STATIC_FILES’].present?
Disable SSL initially to testing
config.force_ssl = false
config.assume_ssl = true
config.hosts.clear
ERROR – : [ActionDispatch::HostAuthorization::DefaultResponseApp] Blocked hosts: app-56pkj3x1np35tj64z0qdew9m-server-qojgpy1n6r23ivqwlvdr8z52.network:80, 63dc6ea9.blsm.blossom-cloud.com
Access to 63dc6ea9.blsm.blossom-cloud.com was denied You don’t have authorization to view this page. HTTP ERROR 403
Helps:
App Logs Caddy Logs at cluster level
2025-01-13 02:33:21PM [2a6c6c0e-331a-483b-8085-4437e6d5af56] ActionView::Template::Error (The asset “application.css” is not present in the asset pipeline.
- Setup DB: RAILS_ENV=production rails db:create db:migrate db:seed
2025-01-13 05:04:15PM [4d4c4ca1-bc13-49a3-a252-749b19fd9462] ActionView::Template::Error (The asset “application.css” is not present in the asset pipeline.
config.public_file_server.enabled = true
Assets Channels Workaround
config/environments/production.rb
config.assets.compile = true
Or
config/routes.rb
if Rails.env.production?
get '/assets/channels', to: redirect { |_, _|
manifest = JSON.parse(File.read(Dir["public/assets/.sprockets-manifest-*.json"].first))
"/assets/#{manifest['assets']['channels/index.js']}"
}
end
WEB_CONCURRENCY=2
BUNDLE_CLEAN=”1” BUNDLE_DEPLOYMENT=”1” BUNDLE_WITHOUT=”development:test” bundle install
https://community.boltops.com/t/could-not-find-timeout-0-3-1-in-any-of-the-sources/996
pack build test –path . –builder heroku/builder:24