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

kaminari-sinatra defines Rails constant, causing other gems to think Rails is being used #9

Open
brucek opened this issue May 21, 2024 · 0 comments

Comments

@brucek
Copy link

brucek commented May 21, 2024

This is due to loading ActionView which requires Rails.

ActionView claims to not require Rails, but it uses the underlying rails-html-sanitizer gem, which says:

Rails HTML Sanitizer is only intended to be used with Rails applications. If you need similar functionality but aren't using Rails, consider using the underlying sanitization library Loofah directly.

This causes issues loading gems like for instance Papertrail as this line:

if defined?(Rails)
  require "paper_trail/frameworks/rails"

thinks Rails is available and then blows up.

The ideal world is to prevent the Rails constant from being loaded somehow, but at a minimum some documentation around this gem still requiring Rails would probably help clarify the dependency, esp since the name "kaminari-sinatra" kind of implies I can use Sinatra and not need Rails.

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

No branches or pull requests

1 participant