Run debug, error -> Uncaught exception: uninitialized constant AdminPanel::Admin

Answered

I'm getting this error when running debug. I am using rails 6.

Exiting
Uncaught exception: uninitialized constant AdminPanel::Admin
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/inflector/methods.rb:284:in `const_get'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/inflector/methods.rb:284:in `block in constantize'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/inflector/methods.rb:280:in `each'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/inflector/methods.rb:280:in `inject'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/inflector/methods.rb:280:in `constantize'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies/zeitwerk_integration.rb:19:in `constantize'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise.rb:320:in `get'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/mapping.rb:83:in `to'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/mapping.rb:78:in `modules'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/mapping.rb:95:in `routes'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/mapping.rb:162:in `default_used_route'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/mapping.rb:72:in `initialize'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise.rb:350:in `new'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise.rb:350:in `add_mapping'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/rails/routes.rb:243:in `block in devise_for'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/rails/routes.rb:242:in `each'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/devise-4.7.0/lib/devise/rails/routes.rb:242:in `devise_for'
/home/stas8828/Yandex.Disk/WEB_MASTERSKAY/Progects/NDT-Portal/NDT-Nav/config/routes.rb:13:in `block in <main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:429:in `instance_exec'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:429:in `eval_block'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:411:in `draw'
/home/stas8828/Yandex.Disk/WEB_MASTERSKAY/Progects/NDT-Portal/NDT-Nav/config/routes.rb:1:in `<main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:54:in `load'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:41:in `block in load_paths'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:41:in `each'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:41:in `load_paths'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:20:in `reload!'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:30:in `block in updater'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/file_update_checker.rb:83:in `execute'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/routes_reloader.rb:10:in `execute'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application/finisher.rb:184:in `block in <module:Finisher>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `instance_exec'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/initializable.rb:32:in `run'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/initializable.rb:61:in `block in run_initializers'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:228:in `block in tsort_each'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:431:in `each_strongly_connected_component_from'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:349:in `block in each_strongly_connected_component'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `call'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:347:in `each_strongly_connected_component'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:226:in `tsort_each'
/home/stas8828/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/tsort.rb:205:in `tsort_each'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/initializable.rb:60:in `run_initializers'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/application.rb:363:in `initialize!'
/home/stas8828/Yandex.Disk/WEB_MASTERSKAY/Progects/NDT-Portal/NDT-Nav/config/environment.rb:5:in `<main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.1.9/lib/zeitwerk/kernel.rb:23:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:48:in `require_relative'
config.ru:3:in `block in <main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
config.ru:in `new'
config.ru:in `<main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/builder.rb:49:in `eval'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/builder.rb:49:in `new_from_string'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/builder.rb:40:in `parse_file'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/server.rb:319:in `build_app_and_options_from_config'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/server.rb:219:in `app'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/rack-2.0.7/lib/rack/server.rb:354:in `wrapped_app'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:37:in `start'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:147:in `block in perform'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `tap'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands/server/server_command.rb:138:in `perform'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/command/base.rb:65:in `perform'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/command.rb:46:in `invoke'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/railties-6.0.0/lib/rails/commands.rb:18:in `<main>'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency'
/home/stas8828/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require'
/home/stas8828/Yandex.Disk/WEB_MASTERSKAY/Progects/NDT-Portal/NDT-Nav/bin/rails:9:in `<top (required)>'

Process finished with exit code 0

 

My the controller AdminPanel::Admin

class AdminPanel::AdminPanelController < ApplicationController
def index
end
end



Rails.application.routes.draw do
namespace :admin_panel do
resources :articles
end
namespace :admin_panel do
resources :categories
end
namespace :admin_panel do
get '/', to: 'admin_panel#index'
end

# devise_for :admins, class_name: "AdminPanel::Admin"
devise_for :admins, class_name: 'AdminPanel::Admin', controllers: {
:sessions => "admin_panel/admins/sessions",
:passwords => "admin_panel/admins/passwords",
:registrations => "admin_panel/admins/registrations"
}
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
5 comments
Comment actions Permalink

Hello,

just to be sure, does it happen only while debugging or while running as well?

0
Comment actions Permalink

During debugging. https://github.com/astax8828/NDT-Nav

I'd appreciate it if you could take a look at the problem. I think it's not a debugger.

0
Comment actions Permalink

So running the project shows no error, right? Would it be possible to share the project? The link you've shared doesn't contain anything.

1
Comment actions Permalink

https://github.com/astax8828/NDT_Nav

I want to create a portal. And I start with create the admin panel.           

Yes, running the project shows no error.

0
Comment actions Permalink

Thank you for the project, I managed to reproduce. We have a similar issue on our tracker: https://youtrack.jetbrains.com/issue/RUBY-24781
I wrote the developer about your case so please follow that issue.

0

Please sign in to leave a comment.