简体   繁体   English

找不到生成器“active_admin:install”

[英]Could not find generator 'active_admin:install'

I just removed active_admin from my rails app and now trying to add active_admin again.我刚刚从我的 rails 应用程序中删除了 active_admin,现在尝试再次添加 active_admin。

getmfile: gem 'activeadmin', github: 'activeadmin' getmfile: gem 'activeadmin', github: 'activeadmin'

and I ran this command:我运行了这个命令:

rails g active_admin:install

and I met this error:我遇到了这个错误:

Running via Spring preloader in process 4200
Expected boolean default value for '--markerb'; got :erb (string)
Could not find generator 'active_admin:install'. Maybe you meant 'devise:install', 'responders:install' or 'active_record:model'

update: I ran bundle install but no reaction更新:我跑了 bundle install 但没有反应

update: result of rails -T更新:rails -T 的结果

rails about                               # List versions of all Rails frameworks and the environment
rails app:template                        # Applies the template supplied by LOCATION=(/path/to/template) or URL
rails app:update                          # Update configs and some other initially generated files (or use just upda...
rails assets:clean[keep]                  # Remove old compiled assets
rails assets:clobber                      # Remove compiled assets
rails assets:environment                  # Load asset compile environment
rails assets:precompile                   # Compile all the assets named in config.assets.precompile
rails bower:cache:clean                   # Clear the bower cache ('bower cache clean')
rails bower:clean                         # Attempt to keep only files listed in 'main' of each component's bower.json
rails bower:install[options]              # Install components from bower
rails bower:install:deployment[options]   # Install components from bower using previously generated bower.json
rails bower:install:development[options]  # Install both dependencies and devDependencies from bower
rails bower:install:production[options]   # Install only dependencies, excluding devDependencies from bower
rails bower:list                          # List bower components
rails bower:resolve[relative_directory]   # Resolve assets paths in bower components
rails bower:update[options]               # Update bower components
rails bower:update:prune[options]         # Update existing components and uninstalls extraneous components
rails cache_digests:dependencies          # Lookup first-level dependencies for TEMPLATE (like messages/show or comme...
rails cache_digests:nested_dependencies   # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_...
rails db:create                           # Creates the database from DATABASE_URL or config/database.yml for the cur...
rails db:drop                             # Drops the database from DATABASE_URL or config/database.yml for the curre...
rails db:environment:set                  # Set the environment value for the database
rails db:fixtures:load                    # Loads fixtures into the current environment's database
rails db:migrate                          # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rails db:migrate:status                   # Display status of migrations
rails db:rollback                         # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rails db:schema:cache:clear               # Clears a db/schema_cache.dump file
rails db:schema:cache:dump                # Creates a db/schema_cache.dump file
rails db:schema:dump                      # Creates a db/schema.rb file that is portable against any DB supported by ...
rails db:schema:load                      # Loads a schema.rb file into the database
rails db:seed                             # Loads the seed data from db/seeds.rb
rails db:setup                            # Creates the database, loads the schema, and initializes with the seed dat...
rails db:structure:dump                   # Dumps the database structure to db/structure.sql
rails db:structure:load                   # Recreates the databases from the structure.sql file
rails db:version                          # Retrieves the current schema version number
rails dev:cache                           # Toggle development mode caching on/off
rails initializers                        # Print out all defined initializers in the order they are invoked by Rails
rails log:clear                           # Truncates all/specified *.log files in log/ to zero bytes (specify which ...
rails middleware                          # Prints out your Rack middleware stack
rails notes                               # Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)
rails notes:custom                        # Enumerate a custom annotation, specify with ANNOTATION=CUSTOM
rails restart                             # Restart app by touching tmp/restart.txt
rails routes                              # Print out all defined routes in match order, with names
rails secret                              # Generate a cryptographically secure secret key (this is typically used to...
rails stats                               # Report code statistics (KLOCs, etc) from the application or engine
rails test                                # Runs all tests in test folder
rails test:db                             # Run tests quickly, but also reset db
rails time:zones[country_or_offset]       # List all time zones, list by two-letter country code (`rails time:zones[U...
rails tmp:clear                           # Clear cache and socket files from tmp/ (narrow w/ tmp:cache:clear, tmp:so...
rails tmp:create                          # Creates tmp directories for cache, sockets, and pids

update: rails : 5.0.5 rvm: 2.4.1 os: mac更新:rails:5.0.5 rvm:2.4.1 os:mac

update: I ran bundle exec rails g active_admin:install but no reaction.更新:我跑了 bundle exec rails g active_admin:install 但没有反应。

The issue is related with the spring preloader as stated in here该问题与此处所述的弹簧预加载器有关

Restart the spring preloader and you should be able to run the activeadmin generator command.重新启动 spring 预加载器,您应该能够运行 activeadmin 生成器命令。

Command to stop spring停止弹簧的命令

$ ./bin/spring stop

将 gem 添加到您的 Gemfile:gem 'activeadmin'

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

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