簡體   English   中英

活動管理員安裝錯誤

[英]Active admin install error

嘗試運行命令時出現錯誤:

rails g active_admin:install

錯誤是:

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:在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: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:in install_devise中來自/home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27 :在run' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:inrun' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' /gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133 block in invoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation中的block in invoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in .rb:133:在map' 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:in invoke_all'來自/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:in /home/user/.rvm/gems/ruby-2.2 .0 / gems / thor-0.19.1 / lib / thor / group.rb:277:在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: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:in with_padding'來自/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_for_class_method':來自/home/user/.rvm/gems的_invoke_from_option_users /ruby-2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27: run' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133 run' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command中:in block in invoke_all' 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:in :1 block in invoke_all' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in每個'來自/home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133 block in invoke_all' 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:in來自/home/user/.rvm/gems/ruby-2.2.0/gems/的invoke_all'中dispatch' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in 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:in從“ /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/generators開始” dispatch' from /home/user/.rvm/gems/ruby-2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:ininvoke' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/generate.rb:13:in /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:in require_command!' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:130:in generate_or_destroy' /ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:50 generate' from /home/user/.rvm/gems/ruby-2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in run_command中!'' 來自<top (required)>' from /home/user/projectX/bin/rails:8:in /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 '來自/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:in -e:1:in`'

已安裝活動的admin和devise gem。 唯一的問題是當我生成活動管理員時。 我使用Rails-4.1.8和ruby-2.1.4。

感謝您的幫助和美好的一天。

您需要將gem'devise gem 'devise'添加到Gemfile或直接使用cli

bundle add devise

或者您需要使用--skip-users標志運行安裝。

rails g active_admin:install --skip-users

activeadmin gem(我的意思是rubygems.org上的gem的最新版本)仍然與Rails 4.x不兼容。

嘗試從存儲庫中使用使用最新版本的activeadmin:

gem 'activeadmin', github: 'activeadmin/activeadmin', branch: :master

為我工作。

gem 'devise', '~> 3.2'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM