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 1 year has passed since last update.

Rails PumaのDaemonaization設定

Last updated at Posted at 2022-04-29

概要

EC2にnginxの構築を完了し、RailsのPamaデーモン化を構築した際の備忘録として。

環境

  • Mac M1 macbookAir
  • Rails 6.0.4.8
  • ruby 2.6.5
  • Bundler 1.17.2

Gemfileに追記し、bundle installの実施

Gemfile
<省略>

# Use Puma as the app server
$ gem 'puma', '~> 5.0'                                  #5.0に変更
$ gem 'puma-daemon', require: false        #追記

<省略>

# bundle installの実施
$ bundle install --path vender/bundle

config/puma.rbに追記し、pumaを起動

Config/puma.rb
<省略>

require 'puma/daemon'                            #この行を追加
root_dir="/var/www/〇〇〇〇"                                            #〇〇〇〇には自分のアプリ名を入力
bind "unix://#{root_dir}/tmp/sockets/puma.sock"  #(root_dir)部分のみ修正
workers 3                                                                            #この行を追加
threads 2,3                                                                           #この行を追加
daemonize                                                                             #この行を追加

<省略>

# pumaの起動
$ bundle exec pumactl start

この状態が表示されたらOK
スクリーンショット 2022-04-29 10.05.48.png

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?