2

I have an error, when try to run command:

rails g active_admin:install

The error is:

user@user1:~/projectX$ rails g active_admin:install invoke devise /home/user/.rvm/gems/ruby-2.2.0/bundler/gems/activeadmin-6bde1f57ec5f/lib/generators/active_admin/devise/devise_generator.rb:21:in rescue in install_devise': uninitialized constant ActiveAdmin::Generators::DeviseGenerator::DependencyError (NameError) from /home/user/.rvm/gems/ruby-2.2.0/bundler/gems/activeadmin-6bde1f57ec5f/lib/generators/active_admin/devise/devise_generator.rb:19:ininstall_devise' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ineach' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ininvoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:ininvoke' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/group.rb:277:in block in _invoke_for_class_method' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/shell.rb:68:inwith_padding' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/group.rb:266:in _invoke_for_class_method' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/group.rb:133:in_invoke_from_option_users' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in block in invoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ineach' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in map' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:ininvoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in dispatch' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/generators.rb:157:in invoke' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/generate.rb:13:in' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:123:in require_command!' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:130:ingenerate_or_destroy' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:50:in generate' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:inrun_command!' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in <top (required)>' from /home/user/projectX/bin/rails:8:in' from /home/user/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' from /home/user/.rvm/rubies/ruby-2.2.0/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from -e:1:in `'

Active admin and devise gems are installed. The only problem is when I generate active admin. I use Rails-4.1.8 and ruby-2.1.4.

Thanks for help and good day.

3

3 Answers 3

6

You need to add the gem 'devise' to your Gemfile or directly using the cli

bundle add devise

or you need to run the install with the the --skip-users flag.

rails g active_admin:install --skip-users
-1

activeadmin gem (I mean latest version of gem on rubygems.org) still is not compatible with Rails 4.x.

Try to use use latest version of activeadmin from repository:

gem 'activeadmin', github: 'activeadmin/activeadmin', branch: :master
10
  • I tried this, but it doesn`t work. Same error message.
    – projectxxx
    Feb 26, 2015 at 19:50
  • It's very strange. I can't reproduce your problem. Could you please provide full backtrace?
    – Maxim
    Feb 26, 2015 at 21:00
  • I reinstall my operation system and rvm two-three times, but not work.
    – projectxxx
    Feb 26, 2015 at 22:52
  • Could you please provide your Gemfile? AA raise DependencyError exception if devise version isn't equal to ~> 3.2. May be you are using 3.1 for example.
    – Maxim
    Feb 27, 2015 at 0:06
  • i tried to change devise version, but doesn`t work. I give you a link to pastebin with content to my Gemfile. pastebin.com/EWxfLBrv
    – projectxxx
    Feb 27, 2015 at 7:55
-1

Works for me.

gem 'devise', '~> 3.2'
1
  • 1
    This answer turned up in the low quality review queue, presumably because you don't provide any explanation of the code. If this code answers the question, consider adding adding some text explaining the code in your answer. This way, you are far more likely to get more upvotes — and help the questioner learn something new.
    – lmo
    Jun 12, 2016 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.