LoginSignup
6
6

Nginx + Unicorn for Rails on Rackhub

Last updated at Posted at 2012-09-05

概要

RackHub 上で、Rails + Nginx + Unicorn をプロダクション環境で構築する方法を紹介します。

やり方

Rails アプリの Gemfile 内に Unicorn を追加します。

gem 'unicorn'

次に、$RAILS_ROOT 変数が設定されているかどうかをチェックします。

echo $RAILS_ROOT

もし設定されていなかったら、次のようにして $RAILS_ROOT を設定します。

export RAILS_ROOT=$HOME/sample_app

なお、上記の sample_app には、実際の Rails アプリケーションの名前を代入して下さい。

最後に、次のコマンドを実行します。

curl -s -L https://gist.github.com/raw/2129714/install.sh | bash

うまく設定が出来ていたら、これで Rails + Nginx + Unicorn のプロダクション環境が構築できているはずです。お手持ちのブラウザでチェックしてみて下さい。

本投稿は、次の Gist を fork して日本語訳したものです。
Gist - Nginx + Unicorn for Rails on Rackhub

  • 作者から許諾も頂きました。
6
6
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
6
6