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

NameError: uninitialized constant ActiveModel::Serializer::Reflection #59

Closed
pramodshinde opened this issue Apr 5, 2021 · 4 comments · Fixed by #60
Closed

NameError: uninitialized constant ActiveModel::Serializer::Reflection #59

pramodshinde opened this issue Apr 5, 2021 · 4 comments · Fixed by #60

Comments

@pramodshinde
Copy link

Please help me with the issue, I'm missing something?

Added following gems, bundle ran smoothly

active_model_serializers 0.9.3
batch-loader 1.5.0
ams_lazy_relationships 0.3.0

On running rake middlewares or rails c getting following error,

rake aborted!
NameError: uninitialized constant ActiveModel::Serializer::Reflection
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/ams_lazy_relationships-0.3.0/lib/ams_lazy_relationships/extensions/reflection.rb:71:in <top (required)>' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/ams_lazy_relationships-0.3.0/lib/ams_lazy_relationships/extensions.rb:3:in <top (required)>'
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/ams_lazy_relationships-0.3.0/lib/ams_lazy_relationships.rb:7:in <top (required)>' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in require'
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:74:in block (2 levels) in require' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in each'
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:69:in block in require' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in each'
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler/runtime.rb:58:in require' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/gems/bundler-2.1.4/lib/bundler.rb:174:in require'
/Users/pramod/projects/tpn/bullet_api/config/application.rb:20:in <top (required)>' /Users/pramod/projects/tpn/bullet_api/Rakefile:4:in require'
/Users/pramod/projects/tpn/bullet_api/Rakefile:4:in <top (required)>' /Users/pramod/.rvm/gems/ruby-2.6.6@my_project/bin/ruby_executable_hooks:24:in eval'
/Users/pramod/.rvm/gems/ruby-2.6.6@my_project/bin/ruby_executable_hooks:24:in `

'
(See full trace by running task with --trace)

@stokarenko
Copy link
Collaborator

Hi @pramodshinde )

try to use active_model_serializers ~> 0.10, should be working )
we need to add this condition to gemspec I guess, @Bajena is it ok to you? )

@pramodshinde
Copy link
Author

@stokarenko Thanks for the response.

Is it not supported with active_model_serializers 0.9.X? Unfortunately I am on AMS 0.9.x upgrading to 0.10 is major activity.

@stokarenko
Copy link
Collaborator

@pramodshinde yeah we are forced to patch ActiveModel::Serializer::Reflection which comes into play within v0.10.0.rc3..

AMS 0.9 is super old though, upgrade to 0.10 may still be an option.. Indeed, it brings some breaking changes but they are pretty light and I bet (well, I hope) most projects will not feel the difference )

@Bajena
Copy link
Owner

Bajena commented Apr 13, 2021

I agree with @stokarenko - adding support for lower versions would be too much work. I posted a PR to lock min version of AMS to 0.10.0.rc4: #60

Bajena added a commit that referenced this issue Apr 14, 2021
* Lock minimum AMS version to 0.10.0.rc4

closes #59

* Add thread_safe dependency
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