Open dhampik opened 9 years ago
i have this issue too
Could not find generator 'admin:scaffold_controller'. Maybe you meant 'scaffold_controller' or 'responders_controller' or 'test_unit:controller'
Run `rails generate --help` for more options.
imac:EatsEasyRoR Georg$ rails g admin:scaffold_controller City name:string lat:decimal lng:decimal
[WARNING] Could not load generator "generators/admin/scaffold_controller/scaffold_controller_generator". Error: Admin is not a module.
/Library/Ruby/Gems/2.0.0/gems/rails-admin-scaffold-0.1.0/lib/generators/admin/scaffold_controller/scaffold_controller_generator.rb:5:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/Library/Ruby/Gems/2.0.0/gems/railties-4.2.1/lib/rails/generators.rb:334:in `block (2 levels) in lookup'
Gemfile
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use postgresql as the database for Active Record
gem 'pg'
#sudo env ARCHFLAGS="-arch x86_64" gem install pg
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem "therubyracer"
gem "less-rails"
gem 'sass-rails'
gem "compass-rails", '>= 2.0.4'
gem 'bootstrap-sass'
gem "twitter-bootstrap-rails"
gem 'simple_form'gem 'devise'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-vkontakte'
gem 'rabl'
gem 'oj'
gem 'gon'
#use jsonview chrome extension
gem 'rails-admin-scaffold'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
I did some research.
It is conflict between class Admin
generated by devise_for :admin
(code) and rails-admin-scaffold module Admin
(code)
Tmp solution:
devise_for :admins
in you routes.rbrails g admin:scaffold_controller ...
commanddevise_for :admins
in you routes.rbP.S. It is not issue of devise. It is conflict between name of generated by devise class and name of existing module in current gem.
Sorry for my English;)
Thanks so much @maslenkov...your solution solved my issue.
I have a problem. After active, it said that : "Model Users could not be found". Help me please!!!
@anhkt can you add more details. And please push minimal app which reproduces this bug.
FYI:
rails g admin:scaffold_controller TermsOfService details:string --parent_controller=administration [WARNING] Could not load generator "generators/admin/scaffold_controller/scaffold_controller_generator". Error: Admin is not a module. /usr/local/rvm/gems/ruby-2.2.1/gems/rails-admin-scaffold-0.1.0/lib/generators/admin/scaffold_controller/scaffold_controller_generator.rb:5:in `<top (required)>'