0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【AWS】デプロイ後のエラー

Last updated at Posted at 2021-02-07

内容:unicornの起動時にworking_directoryと表示される

エラー文を詳細に見ると
ArgumentError: config_file=config/unicorn.rb would not be accessible in working_directory=/var/www/current
との表示。

AWSエラー文、解決の流れ

  1. エラー文の内容を翻訳
  2. エラー文をググる

1.エラー文の内容を翻訳 

エラー文の全容が分からなくてもOK。断片的な事から理解し紐解く。
app_pathとは アプリケーションコードが設置されているディレクトリを変数に入れておく
事。
この時点で下記をapp_pathとして指定
app_path = File.expand_path(‘../../‘../‘, FILE)
working_directory とは アプリケーションの設置されているディレクトリ
working_directory "#{app_path}/current" と指定

この場合のエラー文、
ArgumentError :メソッドの引数が正しくない時や足りない時に発生するエラー
config_file=config/unicorn.rb 
would not be accessible in : アクセスできません。
まとめると working_directoryの引数が正しくないからconfig/unicorn.rb
にアクセスできませんとなる。

2.エラー文をググる

AWS would not be accessible in working_directory でググる
同様のケースと思われるtaratailを発見
私の場合、app_path = File.expand_path(‘../../../‘, FILE)
と指定されていたので、メソッドの引数が多い為
エラーが起こったと考えられる。
app_path = File.expand_path('../../', FILE)
と修正したら解決。

参考情報
以下のページを参照しました。ありがとうございました。
https://teratail.com/questions/229963

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?