すべてのコントローラでこのエラーが発生し始めました。 私はUIで作業していたので、何が起こったのかわかりません。そのため、CSS、ERBファイルを読み込んでから、ページをリロードしてこのエラーが発生します。定数を自動読み込みできませんApplicationController(すべてのコントローラ)
ありがとうございました。
コントローラ:(アプリ/コントローラ/ ...)home_controllerで
home_controller.rb
application_controller.rb
:application_controllerで
class HomeController < ApplicationController
def index
end
end
:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
ルート:
Rails.application.routes.draw do
devise_for :admins, path: '', path_names: { sign_in: 'login', sign_out: 'logout'}
# HOME
root to: 'home#index'
# MESSENGER
match '/webhook', :controller => 'messenger', :action => 'callback', :via => :post
get '/webhook' => 'messenger#verify_callback'
end
エラー:(定数とパスを除くすべてのコントローラで同じエラー)
LoadError (Unable to autoload constant HomeController, expected /home/ubuntu/line/app/controllers/home_controller.rb to define it):
activesupport (5.0.1) lib/active_support/dependencies.rb:512:in `load_missing_constant'
activesupport (5.0.1) lib/active_support/dependencies.rb:203:in `const_missing'
activesupport (5.0.1) lib/active_support/inflector/methods.rb:268:in `const_get'
activesupport (5.0.1) lib/active_support/inflector/methods.rb:268:in `block in constantize'
activesupport (5.0.1) lib/active_support/inflector/methods.rb:266:in `each'
activesupport (5.0.1) lib/active_support/inflector/methods.rb:266:in `inject'
activesupport (5.0.1) lib/active_support/inflector/methods.rb:266:in `constantize'
activesupport (5.0.1) lib/active_support/dependencies.rb:583:in `get'
activesupport (5.0.1) lib/active_support/dependencies.rb:614:in `constantize'
actionpack (5.0.1) lib/action_dispatch/http/request.rb:81:in `controller_class'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:30:in `serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `each'
actionpack (5.0.1) lib/action_dispatch/journey/router.rb:26:in `serve'
actionpack (5.0.1) lib/action_dispatch/routing/route_set.rb:725:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
rack (2.0.1) lib/rack/etag.rb:25:in `call'
rack (2.0.1) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.1) lib/rack/head.rb:12:in `call'
rack (2.0.1) lib/rack/session/abstract/id.rb:222:in `context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.0.1) lib/active_record/migration.rb:553:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
activesupport (5.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
activesupport (5.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
activesupport (5.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
actionpack (5.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
web-console (3.4.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.4.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `catch'
web-console (3.4.0) lib/web_console/middleware.rb:18:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.0.1) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.0.1) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.0.1) lib/rails/rack/logger.rb:24:in `call'
sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
rack (2.0.1) lib/rack/method_override.rb:22:in `call'
rack (2.0.1) lib/rack/runtime.rb:22:in `call'
activesupport (5.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.0.1) lib/action_dispatch/middleware/static.rb:136:in `call'
rack (2.0.1) lib/rack/sendfile.rb:111:in `call'
railties (5.0.1) lib/rails/engine.rb:522:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:97:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:152:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:113:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:416:in `block (3 levels) in start_threads'
/usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:113:in `block in create_thread_and_abort_on_exception'
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.1ms)
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.3ms)
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (20.3ms)
Started POST "/webhook" for 66.220.152.184 at 2017-02-20 04:02:49 +0000
Cannot render console from 66.220.152.184! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
LoadError (Unable to autoload constant ApplicationController, expected /home/ubuntu/line/app/controllers/application_controller.rb to define it):
app/controllers/messenger_controller.rb:3:in `<top (required)>'
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.2ms)
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.6ms)
Rendering /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
Rendered /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/actionpack-5.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.7ms)
何が変更されましたか...教えてください。 – Milind
CSSとHTMLのほんの数行何もアプリケーション全体に影響することはありません..私は変更を取り消して、同じエラーを取得しようとしました – liborza
あなたのroutes.rbを表示してください – Milind