LoginSignup
1
2

More than 3 years have passed since last update.

EC2へcapistranoを使ってrailsアプリケーションをデプロイしている場合のログ確認

Posted at

EC2でrailsアプリケーションをデプロイしています。
その際にページへアクセスした際、以下のようなエラーが、、

The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.

If you are the application owner check the logs for more information.

railsがうまく動いていない時のエラーのようなので、
エラーログをみていきます。

見るべきログファイルの場所

アプリケーションディレクトリ内にあるcurrentというフォルダ

capistranoを使っている場合、ルートディレクトリはこのフォルダになるとのこと

アプリーケーション/current/log
このディレクトリに production.log unicorn.stderr というファイルがある。

これらのファイルを確認していく

logの確認コマンド

$ less production.log

↑ログの一番上から表示させる。

tail production.log

↑ログの末尾から表示させる。

tailf production.log

↑ログをリアルタイム更新で確認する

今回はtailfでproduction.logを確認した所、リアルタイムに動いていなかったため
それよりも前の段階でエラーが起きていると考えました。

次にunicorn.stderrを確認したい所だったのですが、
先にunicornが動いているか確認したと所動いていませんでした。

bundle exec cap production unicorn:start

で解決しました。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2