activeadmin: There was an error while trying to load the gem 'activeadmin'.

On my rails 5 app I want to use the active admin gem, I used active admin in rails 4 apps before but now it gives me an error that I can’t find a solution for it. I’m using Sequel as ORM, but I think that shouldn’t be causing the error I get, I get the error from the bundler and I tried different versions of it, but no luck. In my gem file:

gem 'activeadmin', '~> 1.0.0.pre4'
gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources'

here is the error I get after I run rails g active_admin:install

/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'activeadmin'. (Bundler::GemRequireError)
Gem Load Error is: undefined method `require_constants' for nil:NilClass
Did you mean?  require_or_load
Backtrace for gem load error is:
/var/lib/gems/2.3.0/gems/ransack-1.8.2/lib/ransack.rb:5:in `<top (required)>'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/var/lib/gems/2.3.0/gems/activeadmin-1.0.0.pre4/lib/active_admin.rb:4:in `<top (required)>'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
/var/lib/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
/var/lib/gems/2.3.0/gems/activeadmin-1.0.0.pre4/lib/activeadmin.rb:1:in `<top (required)>'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:91:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `block in require'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `each'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `require'
/var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler.rb:107:in `require'
/home/petar/qarquest/backend/config/application.rb:22:in `<top (required)>'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require_application_and_environment!'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:143:in `generate_or_destroy'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:60:in `generate'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
/var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Bundler Error Backtrace:
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `each'
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:86:in `block in require'
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `each'
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler/runtime.rb:75:in `require'
	from /var/lib/gems/2.3.0/gems/bundler-1.14.3/lib/bundler.rb:107:in `require'
	from /home/petar/qarquest/backend/config/application.rb:22:in `<top (required)>'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:156:in `require_application_and_environment!'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:143:in `generate_or_destroy'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:60:in `generate'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /var/lib/gems/2.3.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Here you go! I recommend you go to ransack and ask for the feature or try to implement it yourself! 😉

Ok, I see the problem now, ransack does not provide a sequel adapter.

To confirm, could you manualy edit the file resulting from running

echo $(bundle show ransack)/lib/ransack/adapters.rb

with the following diff

diff --git a/lib/ransack/adapters.rb b/lib/ransack/adapters.rb
index 41cc2e6..8344f26 100644
--- a/lib/ransack/adapters.rb
+++ b/lib/ransack/adapters.rb
@@ -10,6 +10,8 @@ module Ransack
         ActiveRecordAdapter.new
       elsif defined?(::Mongoid)
         MongoidAdapter.new
+      else
+        raise "Unsupported adapter"
       end
     end

and try again?