roar-rails
roar-rails copied to clipboard
Rail 6 API - uninitialized constant ActionController::Responder (NameError)
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:in
without_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:inrescue 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:in
load_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?
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
@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.