trailblazer / roar-rails

Use Roar's representers in Rails.
http://roar.apotomo.de
MIT License
235 stars 62 forks source link

Rail 6 API - uninitialized constant ActionController::Responder (NameError) #138

Open rusikf opened 4 years ago

rusikf commented 4 years ago

Hi guys, when I run

rails g representer Post

On rails 6 api app I receive

/home/rusikf/.rvm/gems/ruby-2.6.4/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in block in load_missing_con stant': uninitialized constant ActionController::Responder (NameError) from /home/rusikf/.rvm/gems/ruby-2.6.4/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:9:inwithout_boots nap_cache'
from /home/rusikf/.rvm/gems/ruby-2.6.4/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:80:in rescue in lo ad_missing_constant' from /home/rusikf/.rvm/gems/ruby-2.6.4/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:inload_missing _constant'
from /home/rusikf/.rvm/gems/ruby-2.6.4/gems/roar-rails-1.1.0/lib/roar/rails/rails4_0_strategy.rb:2:in <module:Rails>' from /home/rusikf/.rvm/gems/ruby-2.6.4/gems/roar-rails-1.1.0/lib/roar/rails/rails4_0_strategy.rb:1:in

'

I included in Gemfile: roar-rails, responders, multi_json gems

How to fix it ? Is it possible to add readme note about it? Also, this gem requires gem 'multi_json', is it possible to add note to README?

and0x000 commented 3 years ago

This is due to the gem not having a strategy for Rails 6.

The most recent version supported is rails 5.1. See: https://github.com/apotonick/roar-rails/blob/master/lib/roar-rails.rb#L38

The gem looks pretty much abandoned, as some other pull requests, that would support at least rails 5.2 were not merged.

See https://github.com/apotonick/roar-rails/pull/139

apotonick commented 3 years ago

@and0x000 Please send a PR for a Rails 6 strategy. :beers: We can discuss whether or not we want to support the responder logic.

Roar-rails is slowly superseded by Trailblazer's endpoints, or people do rendering manually in operations, so there was less interest in this particular glue gem.