LoginSignup
7
11

More than 3 years have passed since last update.

UnicornでRailsアプリケーション起動時「master failed to start, check stderr log for details」

Last updated at Posted at 2019-05-19

普段Unicornはゴリゴリ触らず、エラーを見て一瞬「うっ」となってしまったため、作業ログ的に残しときます。

環境

  • AWS EC2環境(CLI接続)
  • Unicorn(5.5.0)
  • Rails(5.2)
  • Ruby(2.4.1)

起きたこと

EC2の本番環境でUnicornを起動しようと、以下のコマンドをコピペして実行したらエラーが出て起動できなかった。

aws-cli
[name]$ unicorn_rails -c /var/www/rails/hogehoge(アプリ名)/config/unicorn.conf.rb -D -E production
master failed to start, check stderr log for details

ログを見る

Unicornのログを見ると、怪しげなエラー発見。
引数エラーっぽいが、コマンドは間違っていないはず。

[name|shared]$ tail log/unicorn_error.log
ArgumentError: wrong number of arguments (given 0, expected 2)

原因

Unicornの最新バージョン(5.5.0)でメソッドの仕様にアップデートがあったため、発生したエラー見たいです。以下のコマンドで環境下のUnicornのバージョンが分かります。

local
$ bundle exec gem list | grep unicorn

対応

GemfileでUnicornのバージョンを固定し bundle install しました。

Gemfile
# バージョンを指定
gem 'unicorn', '5.4.1'
local
$ bundle install
$ bundle exec gem list | grep unicorn
unicorn (5.4.1)
7
11
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
7
11