10000 Conflict Between Camaleon CMS and Administrate Gem Due to Sass Processor Dependencies in Rails · Issue #1111 · owen2345/camaleon-cms · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Conflict Between Camaleon CMS and Administrate Gem Due to Sass Processor Dependencies in Rails #1111

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

Open
labanidas opened this issue Mar 1, 2025 · 2 comments

Comments

@labanidas
Copy link

Camaleon CMS depends on dartsass-sprockets for its styling, whereas the Administrate gem uses sassc-rails. When I attempt to install and initialize both gems in my Rails application, I encounter a series of initialization conflicts and warnings about redefined constants and cyclic dependencies involving these Sass processors.

Error Message :

/usr/local/rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/tsort.rb:230:in `block in tsort_each': topological sort failed: [#<Rails::Initializable::Initializer:0x00007ffff80afcf8 @name=:setup_compression, @context=#SassC::Rails::Railtie, @options={:group=>:all, :after=>:setup_sass}, @block=#<Proc:0x00007f003c10c988 /usr/local/rvm/gems/ruby-3.0.0/gems/dartsass-sprockets-3.0.0/lib/sassc/rails/railtie.rb:72>>, #<Rails::Initializable::Initializer:0x00007ffff80afca8 @name=:setup_sass, @context=#SassC::Rails::Railtie, @options={:group=>:all, :after=>:setup_compression}, @block=#<Proc:0x00007ffff7cb06c0 /usr/local/rvm/gems/ruby-3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/railtie.rb:34>>, #<Rails::Initializable::Initializer:0x00007ffff80afc30 @name=:setup_compression, @context=#SassC::Rails::Railtie, @options={:group=>:all, :after=>:setup_sass}, @block=#<Proc:0x00007ffff7cb05a8 /usr/local/rvm/gems/ruby-3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/railtie.rb:72>>] (TSort::Cyclic)


Versions I am using

Ruby- 3.0.0

Rails - 7.1.4

Administrate - 0.20.1

Camaleon cms - 2.9.0

windows 10


Questions:

  1. Has anyone successfully integrated both Camaleon CMS and Administrate in a Rails app without encountering Sass processor conflicts?
  2. Are there known workarounds or modifications I can apply to coexist both gems peacefully?

Thank you!

@brian-kephart
Copy link
Collaborator

I just took a look, and it appears that this issue was resolved in the Administrate repo as of thoughtbot/administrate#2397. However, the last release of that gem was prior to that PR being merged. It seems like until that gem issues a release, you will have to use it via git.

gem "administrate", git: "https://github.com/thoughtbot/administrate.git"

@labanidas
Copy link
Author

Thank you! @brian-kephart I successfully got my application running with both Camaleon CMS and Administrate installed. However, I encountered another challenge afterward—when accessing the admin dashboard, I received an error: undefined method 'per'.

This issue occurs due to a conflict between the kaminari and will_paginate gems; Administrate depends on kaminari, while Camaleon CMS relies on will_paginate. I cannot remove either gem since both are necessary dependencies.

I resolved this conflict by creating an initializer (config/initializers/will_paginate.rb) to alias will_paginate methods to match those required by kaminari:

# config/initializers/will_paginate.rb
if defined?(WillPaginate)
  module WillPaginate
    module ActiveRecord
      module RelationMethods
        alias_method :per, :per_page
        alias_method :num_pages, :total_pages
      end
    end
  end
end

module ActiveRecord
  class Relation
    alias_method :total_count, :count
  end
end

This solution originated from the following Stack Overflow discussion:
https://stackoverflow.com/questions/14958438/rails-activeadmin-undefined-method-per-for-activerecordrelation0x4d15ee

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

2 participants
0