前提・実現したいこと
修正したソースをデプロイ後にRoutingErrorが発生したため原因を特定し、アプリが正常に動くようにしたいです。
発生している問題・エラーメッセージ
【production.log】
I, [2018-03-27T11:00:40.545890 #20406] INFO -- : Started GET "/login/login" for 127.0.0.1 at 2018-03-27 11:00:40 +0900 F, [2018-03-27T11:00:40.547779 #20406] FATAL -- : ActionController::RoutingError (No route matches [GET] "/login/login"): actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.5) lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.5) lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.4) lib/rack/methodoverride.rb:22:in `call' rack (1.6.4) lib/rack/runtime.rb:18:in `call' activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' rack (1.6.4) lib/rack/sendfile.rb:113:in `call' railties (4.2.5) lib/rails/engine.rb:518:in `call' railties (4.2.5) lib/rails/application.rb:165:in `call' unicorn (5.2.0) lib/unicorn/http_server.rb:562:in `process_client' unicorn (5.2.0) lib/unicorn/http_server.rb:658:in `worker_loop' unicorn (5.2.0) lib/unicorn/http_server.rb:508:in `spawn_missing_workers' unicorn (5.2.0) lib/unicorn/http_server.rb:132:in `start' unicorn (5.2.0) bin/unicorn_rails:209:in `<top (required)>' /usr/local/rbenv/versions/2.3.0/bin/unicorn_rails:23:in `load' /usr/local/rbenv/versions/2.3.0/bin/unicorn_rails:23:in `<top (required)>' bundler (1.13.6) lib/bundler/cli/exec.rb:74:in `load' bundler (1.13.6) lib/bundler/cli/exec.rb:74:in `kernel_load' bundler (1.13.6) lib/bundler/cli/exec.rb:27:in `run' bundler (1.13.6) lib/bundler/cli.rb:332:in `exec' bundler (1.13.6) lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' bundler (1.13.6) lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' bundler (1.13.6) lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' bundler (1.13.6) lib/bundler/cli.rb:20:in `dispatch' bundler (1.13.6) lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' bundler (1.13.6) lib/bundler/cli.rb:11:in `start' bundler (1.13.6) exe/bundle:34:in `block in <top (required)>' bundler (1.13.6) lib/bundler/friendly_errors.rb:100:in `with_friendly_errors' bundler (1.13.6) exe/bundle:26:in `<top (required)>' /usr/local/rbenv/versions/2.3.0/bin/bundle:23:in `load' /usr/local/rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
該当のソースコード
【config/unicorn.rb】
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true # 更新時ダウンタイム無し listen "/tmp/unicorn.sock" pid "/tmp/unicorn.pid" before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' end defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end # ログの出力 stderr_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT']) stdout_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])
【config/routes.rb】
Rails.application.routes.draw do #root 'functions#new' get 'functions' => 'functions#new' # post 'ymst' => 'ymst#create' post 'ymst' => 'ymst#orderimport' get 'ymst/updater' resources :ymst resources :cs_comp_dsts #match ':controller(/:action(/:id))', via: [:get, :post, :patch] root 'chokotto#index' get 'login' => 'login#login' get 'top' => 'chokotto#index', as: :top get "/auth/:provider/callback" => "sessions#create" get "/signout" => "sessions#destroy", :as => :signout end
補足情報(FW/ツールのバージョンなど)
・AWS+Nginx+Unicornでproduction環境は構成しています。
・開発環境(Cloud9)では正常に動作しています。
あなたの回答
tips
プレビュー