I have a vanilla Solidus installation (ruby 3.0 | rails 6.1.5)
I'm using the edge guide to test a deployment on Heroku. I get the following error on my local machine if I configure active storage to use :amazon in my storage.yml file.
The remote deployment also results in an error. Running heroku logs --tail
gives the following error in my Terminal:
from /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2022-03-24T21:23:47.656577+00:00 app[web.1]: from bin/rails:5:in `<main>'
2022-03-24T21:23:47.825835+00:00 heroku[web.1]: Process exited with status 1
2022-03-24T21:23:47.876809+00:00 heroku[web.1]: State changed from starting to crashed
2022-03-24T21:23:47.885875+00:00 heroku[web.1]: State changed from crashed to starting
2022-03-24T21:23:54.753814+00:00 heroku[web.1]: Starting process with command `bin/rails server -p ${PORT:-5000} -e production`
2022-03-24T21:23:59.021982+00:00 app[web.1]: => Booting Puma
2022-03-24T21:23:59.022013+00:00 app[web.1]: => Rails 6.1.5 application starting in production
2022-03-24T21:23:59.022013+00:00 app[web.1]: => Run `bin/rails server --help` for more startup options
2022-03-24T21:24:00.921589+00:00 app[web.1]: Exiting
2022-03-24T21:24:00.922353+00:00 app[web.1]: /app/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.5/lib/active_storage/service/configurator.rb:17:in `build': undefined method `fetch' for nil:NilClass (NoMethodError)
2022-03-24T21:24:00.922355+00:00 app[web.1]: from /app/vendor/bundle/ruby/3.0.0/gems/activestorage-6.1.5/lib/active_storage/service/registry.rb:13:in `block in fetch'
There are no errors if I configure active storage to use the local disk. Appreciate any assistance or insight.
Update:
Storage.ymltest:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: Disk
root: <%= Rails.root.join("storage") %>
amazon:
service:S3
access_key_id: ""
secret_access_key:
region:
bucket:
Config/environment/production.rb
require "active_support/core_ext/integer/time"
Rails.application.configure do
config.cache_classes = true
config.active_storage.service = :amazon
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.compile = false
config.log_level = :info
config.log_tags = [ :request_id ]
config.action_mailer.perform_caching = false
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.active_support.disallowed_deprecation = :log
config.active_support.disallowed_deprecation_warnings = []
config.log_formatter = ::Logger::Formatter.new
ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter=config.log_formatter
config.logger=ActiveSupport::TaggedLogging.new(logger)
end
config.active_record.dump_schema_after_migration = false