下記のUnicornの起動コマンドを実行すると、下記のエラーが表示され、Unicornが起動できません。
お手数ですが、ご存知の方がいらっしゃいましたら、ご教示お願い致します。
実行環境
Amazon Linux2
ruby 2.5.1
Rails 5.2.4.1
Unicornの起動コマンド
command
1unicorn_rails -c /var/www/rails/sns_app/config/unicorn.conf.rb -E production -D
コマンド実行のエラー
Error
1Traceback (most recent call last): 2 11: from /home/sorimachi/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in `<main>' 3 10: from /home/sorimachi/.rbenv/versions/2.5.1/bin/unicorn_rails:23:in `load' 4 9: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `<top (required)>' 5 8: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/bin/unicorn_rails:209:in `new' 6 7: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in `initialize' 7 6: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:77:in `new' 8 5: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:77:in `initialize' 9 4: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in `reload' 10 3: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:84:in `instance_eval' 11 2: from /var/www/rails/sns_app/config/unicorn.conf.rb:12:in `reload' 12 1: from /home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:241:in `timeout' 13/home/sorimachi/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/unicorn-5.4.1/lib/unicorn/configurator.rb:641:in `set_int': not an integer: timeout=nil (ArgumentError) 14master failed to start, check stderr log for details
unicorn.conf.rb
unicorn
1$worker = 2 2$imeout = 30 3$app_dir = "/var/www/rails/sns_app" 4$listen = File.expand_path 'tmp/sockets/.unicorn.sock', $app_dir 5$pid = File.expand_path 'tmp/pids/unicorn.pid', $app_dir 6$std_log = File.expand_path 'log/unicorn.log', $app_dir 7# set config 8worker_processes $worker 9working_directory $app_dir 10stderr_path $std_log 11stdout_path $std_log 12timeout $timeout 13listen $listen 14pid $pid 15# loading booster 16preload_app true 17# before starting processes 18before_fork do |server, worker| 19 defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! 20 old_pid = "#{server.config[:pid]}.oldbin" 21 if old_pid != server.pid 22 begin 23 Process.kill "QUIT", File.read(old_pid).to_i 24 rescue Errno::ENOENT, Errno::ESRCH 25 end 26 end 27end 28# after finishing processes 29after_fork do |server, worker| 30 defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection 31end
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/30 17:25