简体   繁体   English

rails g active_admin:安装错误

[英]rails g active_admin:install ERROR

I have problem with ActiveAdmin. 我在使用ActiveAdmin时遇到问题。 I've added the gem 'activeadmin' to my Gemfile and ran 我已将gem'activeadmin'添加到我的Gemfile中并运行

$ bundle install

which worked. 起作用了。 But when I try to: 但是当我尝试:

$ rails g active_admin:install

I get: 我得到:

/home/dominika/active_admin/config/application.rb:10:in `<module:ActiveAdmin>': superclass mismatch for class Application (TypeError)
from /home/dominika/active_admin/config/application.rb:9:in `<top (required)>'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:82:in `require'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:82:in `preload'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:143:in `serve'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:131:in `block in run'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:125:in `loop'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application.rb:125:in `run'
from /home/dominika/.rvm/gems/ruby-2.2.0/gems/spring-1.2.0/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/dominika/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/dominika/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'

Maybe it's really stupid, but I really don't know how to fix it. 也许这真的很愚蠢,但我真的不知道如何解决。 Please, help... 请帮忙...

This happens because your application is called active_admin . 发生这种情况是因为您的应用程序名为active_admin Rename it, and everything will work. 重命名它,一切都会正常。

To rename the app view this thread to get the instructions. 要重命名应用程序,请查看此线程以获取说明。

Overall it sounds like you are pretty much doing things correctly. 总体来说,这听起来好像您正在正确地做事。

I've added the gem 'active_admin' 我添加了宝石“ active_admin”

From the documentation it's: 从文档中可以看到:

# Gemfile

gem 'activeadmin' 

Does that help? 有帮助吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM