marcel/aws-s3

Error witth ActionView::Base.default_form_builder

Ellyster opened this issue · 2 comments

I wrongly reported it as a Devise bug, when is actually a aws-s3 bug:
heartcombo/devise#3220

Looks like aws-s3 is messing with ActionView::Base.default_form_builder, that instead of returning ActionView::Helpers::FormBuilder is returning nil - this can be replicated by justing generating a scaffold in a fresh app with aws-s3, even without Devise.

Looks like aws-s3 is overriding the cattr_accessor method from ActiveSupport and breaking some Rails internals. I think this should be reported back to the aws-s3 repo and fixed and their end.

I think it might be better to just remove the aws-s3 extension for adding cattr_* method and just add activesupport as a dependency.

This is causing problem if I just create new rails app and add aws-s3 gem, run bundle install and then rails c
You'll get this

lib/aws/s3/extensions.rb:223:in `class_eval': ....
`@@{' is not allowed as a class variable name

I created a forked version that address this. https://github.com/reynardmh/aws-s3
If you want to use this, you can just add to your Gemfile:

gem 'aws-s3', github: 'reynardmh/aws-s3'

I can create a pull request if you think this is a good idea to merge to the main branch.