前提・実現したいこと
Railsにてwebアプリケーションを作っております。
EC2を利用してのデプロイ作業は既に行っており、
自動デプロイとしてcapistranoも導入しております。
見た目は作れているのですが、
サインアップページから新規登録をすると下記のようなエラーページ?が出てしまいます。
ネットで検索をかけてみましたが解決策が不明だったためご相談させていただければと思います。
※ちなみに開発環境では問題なく作動します
以前herokuで実行した際は出なかったエラーなので
イマイチわからない状況です。
試したこと
どのコードを添付すればよいのかわからないのですが
関係ありそうな箇所を添付させていただきます。
(全然関係なかったらすみません
development.rb
config.file_watcher = ActiveSupport::EventedFileUpdateChecker config.action_mailer.default_url_options = { protocol: 'https', host: 'https://ae4965dfa4a04e8c87367d6e80606bec.vfs.cloud9.ap-northeast-1.amazonaws.com' } config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => 'smtp.gmail.com', :user_name => "toreka.bodymake●●●●@gmail.com", #先ほど作成した送信用gmailアドレス :password => "●●●●●●●●", #2段階認証したアカウントで発行したアプリパスワード :authentication => 'login' } end
production.rb
config.action_mailer.default_url_options = { protocol: 'https', host: 'https://torekabodymake.com' } config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => 587, :domain => 'smtp.gmail.com', :user_name => "toreka.bodymake●●●●●●●●@gmail.com", #先ほど作成した送信用gmailアドレス :password => "●●●●●●●●", #2段階認証したアカウントで発行したアプリパスワード :authentication => 'login' } end
他に必要なコードもありましたらおっしゃってください。
補足情報(FW/ツールのバージョンなど)
Rails5.2.4
ruby 2.5.1
AWS
EC2
capistrano
追記(直近のエラーログです)
[ec2-user@ip-172-31-36-245 ~]$ cd /var/www/git_toreka [ec2-user@ip-172-31-36-245 git_toreka]$ cd current [ec2-user@ip-172-31-36-245 current]$ cd log [ec2-user@ip-172-31-36-245 log]$ ls production.log unicorn.stderr.log unicorn.stdout.log [ec2-user@ip-172-31-36-245 log]$ less production.log I, [2021-03-02T12:54:12.635863 #25406] INFO -- : [09b69fd3-3895-4603-acc8-a57c9583c911] Started GET "/actuator/health" for 192.241.228.47 at 2021-03-02 12:54:12 +0000 F, [2021-03-02T12:54:12.636519 #25406] FATAL -- : [09b69fd3-3895-4603-acc8-a57c9583c911] F, [2021-03-02T12:54:12.636563 #25406] FATAL -- : [09b69fd3-3895-4603-acc8-a57c9583c911] ActionController::RoutingError (No route matches [GET] "/actuator/health"): F, [2021-03-02T12:54:12.636591 #25406] FATAL -- : [09b69fd3-3895-4603-acc8-a57c9583c911] F, [2021-03-02T12:54:12.636638 #25406] FATAL -- : [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] railties (5.2.4.4) lib/rails/rack/logger.rb:38:in `call_app' [09b69fd3-3895-4603-acc8-a57c9583c911] railties (5.2.4.4) lib/rails/rack/logger.rb:26:in `block in call' [09b69fd3-3895-4603-acc8-a57c9583c911] activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:71:in `block in tagged' [09b69fd3-3895-4603-acc8-a57c9583c911] activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:28:in `tagged' [09b69fd3-3895-4603-acc8-a57c9583c911] activesupport (5.2.4.4) lib/active_support/tagged_logging.rb:71:in `tagged' [09b69fd3-3895-4603-acc8-a57c9583c911] railties (5.2.4.4) lib/rails/rack/logger.rb:26:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/request_id.rb:27:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/method_override.rb:24:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/runtime.rb:22:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] activesupport (5.2.4.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/executor.rb:14:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] actionpack (5.2.4.4) lib/action_dispatch/middleware/static.rb:127:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/sendfile.rb:110:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] railties (5.2.4.4) lib/rails/engine.rb:524:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/common_logger.rb:38:in `call' [09b69fd3-3895-4603-acc8-a57c9583c911] rack (2.2.3) lib/rack/chunked.rb:98:in `call' I, [2021-03-02T13:45:58.189989 #25406] INFO -- : [592ce5e9-97bf-4a85-9601-c73eb4cf460f] Completed 200 OK in 2ms (Views: 1.8ms) I, [2021-03-02T13:47:36.822221 #25406] INFO -- : [01fb163f-e7f2-4798-a2a7-16add7f15ef8] Started HEAD "/" for 111.7.96.133 at 2021-03-02 13:47:36 +0000 I, [2021-03-02T13:47:36.822912 #25406] INFO -- : [01fb163f-e7f2-4798-a2a7-16add7f15ef8] Processing by MainpagesController#index as HTML I, [2021-03-02T13:47:36.823493 #25406] INFO -- : [01fb163f-e7f2-4798-a2a7-16add7f15ef8] Rendering mainpages/index.html.erb within layouts/application I, [2021-03-02T13:47:36.824449 #25406] INFO -- : [01fb163f-e7f2-4798-a2a7-16add7f15ef8] Rendered mainpages/index.html.erb within layouts/application (0.9ms) I, [2021-03-02T13:47:36.825194 #25406] INFO -- : [01fb163f-e7f2-4798-a2a7-16add7f15ef8] Completed 200 OK in 2ms (Views: 1.9ms) I, [2021-03-02T13:47:38.516015 #25406] INFO -- : [11122505-96d7-4e3d-97f3-e36db8df366a] Started GET "/" for 111.7.96.133 at 2021-03-02 13:47:38 +0000 I, [2021-03-02T13:47:38.516682 #25406] INFO -- : [11122505-96d7-4e3d-97f3-e36db8df366a] Processing by MainpagesController#index as HTML I, [2021-03-02T13:47:38.517266 #25406] INFO -- : [11122505-96d7-4e3d-97f3-e36db8df366a] Rendering mainpages/index.html.erb within layouts/application I, [2021-03-02T13:47:38.518047 #25406] INFO -- : [11122505-96d7-4e3d-97f3-e36db8df366a] Rendered mainpages/index.html.erb within layouts/application (0.7ms) I, [2021-03-02T13:47:38.518842 #25406] INFO -- : [11122505-96d7-4e3d-97f3-e36db8df366a] Completed 200 OK in 2ms (Views: 1.7ms) I, [2021-03-02T13:47:47.797114 #25406] INFO -- : [1bda28d7-64c6-4d6c-8dd1-e3ed72af6d85] Started HEAD "/" for 111.7.96.133 at 2021-03-02 13:47:47 +0000 I, [2021-03-02T13:47:47.797820 #25406] INFO -- : [1bda28d7-64c6-4d6c-8dd1-e3ed72af6d85] Processing by MainpagesController#index as HTML I, [2021-03-02T13:47:47.798426 #25406] INFO -- : [1bda28d7-64c6-4d6c-8dd1-e3ed72af6d85] Rendering mainpages/index.html.erb within layouts/application I, [2021-03-02T13:47:47.799358 #25406] INFO -- : [1bda28d7-64c6-4d6c-8dd1-e3ed72af6d85] Rendered mainpages/index.html.erb within layouts/application (0.9ms) I, [2021-03-02T13:47:47.800210 #25406] INFO -- : [1bda28d7-64c6-4d6c-8dd1-e3ed72af6d85] Completed 200 OK in 2ms (Views: 1.9ms) I, [2021-03-02T13:47:49.896994 #25406] INFO -- : [1ede6649-3b94-4754-85b5-418f4e23a7ac] Started GET "/" for 111.7.96.133 at 2021-03-02 13:47:49 +0000 I, [2021-03-02T13:47:49.897758 #25406] INFO -- : [1ede6649-3b94-4754-85b5-418f4e23a7ac] Processing by MainpagesController#index as HTML I, [2021-03-02T13:47:49.898402 #25406] INFO -- : [1ede6649-3b94-4754-85b5-418f4e23a7ac] Rendering mainpages/index.html.erb within layouts/application I, [2021-03-02T13:47:49.899307 #25406] INFO -- : [1ede6649-3b94-4754-85b5-418f4e23a7ac] Rendered mainpages/index.html.erb within layouts/application (0.8ms) I, [2021-03-02T13:47:49.900156 #25406] INFO -- : [1ede6649-3b94-4754-85b5-418f4e23a7ac] Completed 200 OK in 2ms (Views: 1.9ms) (END)
### 追記(application_controller.rb)
class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :authenticate_user! def after_sign_in_path_for(resource) user_path(current_user) # ログイン後に遷移するpathを設定(ユーザーページへ遷移) end def after_sign_out_path_for(resource) new_user_session_path # ログアウト後に遷移するpathを設定(ログインページへ遷移) end end
registrations_controller
# The path used after sign up. def after_sign_up_path_for(resource) # super(resource) edit_user_path(resource) end # The path used after sign up for inactive accounts. def after_inactive_sign_up_path_for(resource) # super(resource) edit_user_path(resource) end end
回答1件
あなたの回答
tips
プレビュー