Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 - Usage without ActiveStorage and ActiveMailbox enabled #133

Closed
davidwessman opened this issue Jul 19, 2024 · 8 comments · Fixed by #135
Closed

V4 - Usage without ActiveStorage and ActiveMailbox enabled #133

davidwessman opened this issue Jul 19, 2024 · 8 comments · Fixed by #135

Comments

@davidwessman
Copy link

Hello!

We are using the gem for sending email via SES, but we do not have ActionMailbox or ActiveStorage loaded in the app.
On gem version 4.0.1 we therefore cannot load the app due to the error:

Couldn't find Active Storage configuration in /home/runner/work/repo/config/storage.yml

Our application.rb starts like:

require_relative "boot"

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
require "action_cable/engine"
require "sprockets/railtie"
require "rails/test_unit/railtie"

Is there no way to use this gem unless you have ActionMailbox and ActiveStorage enabled?

@mullermp
Copy link
Contributor

Thanks for opening an issue. I think that's the case currently and I'm open to suggestions for how to fix that. Was that also the case for ActiveStorage in version 3?

@davidwessman
Copy link
Author

Thanks for opening an issue. I think that's the case currently and I'm open to suggestions for how to fix that. Was that also the case for ActiveStorage in version 3?

We are currently using version 3 with no problems.

@mullermp
Copy link
Contributor

I'm not able to reproduce this when I create a new rails app. I tried with both require 'rails/all' and with the requires you pasted above. I'm assuming your app was pretty old but then have upgraded it many times? What happens if you add a blank storage.yml file in config? Or at very least, define one for your test environment?

I'm assuming you ran into this because of the new ActionMailbox feature which uses ActiveStorage under the hood.

@davidwessman
Copy link
Author

I'm not able to reproduce this when I create a new rails app. I tried with both require 'rails/all' and with the requires you pasted above. I'm assuming your app was pretty old but then have upgraded it many times? What happens if you add a blank storage.yml file in config? Or at very least, define one for your test environment?

I'm assuming you ran into this because of the new ActionMailbox feature which uses ActiveStorage under the hood.

I am on vacation until mid August and will try to stay away from my work computer. Will get back to you.

@benjaminwols
Copy link

I've run into the same issue. We also don't require active_storage and active_mailbox in our app.

I've added a blank storage.yml file per your suggestion, but that runs into the next error:
gems/activestorage-7.1.3.4/lib/active_storage/attached/model.rb:246:in validate_global_service_configuration': Missing Active Storage service name. Specify Active Storage service name for config.active_storage.service in config/environments/development.rb (RuntimeError)`

I saw there is a PR #135 that addresses this. If you need me to test anything, please let me know.

@mullermp
Copy link
Contributor

I'm currently looking at how to best check for this.

@mullermp
Copy link
Contributor

I think the best thing I can really do is just check for ActionMailbox::Engine unless someone with more rails experience has a better option. Feel free to test that if you wish.

@mullermp
Copy link
Contributor

I just pushed out version 4.0.2 that should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants