RailsにUnicornをセットしています。
Unicornのインストールは完了しているのですが、新規にconfig/unicorn.rbを作成し以下の内容を記述しました。
サイトを参考にしました。(ほとんどコピペです)
config/unicorn.rb worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) timeout 15 preload_app true listen '/home/vagrant/myapp/tmp/unicorn.sock' pid '/home/vagrant/myapp/tmp/unicorn.pid' before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', Process.pid end defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! end after_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' end defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection end stderr_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT']) stdout_path File.expand_path('log/unicorn.log', ENV['RAILS_ROOT'])
最後の2行に ENV['RAILS_ROOT'] と環境変数の呼び出しがあります。
その設定を ~/.bash_profile に追記したいのですが記述方法が不明です。
~/.bash_profile export PATH=$PATH/home/vagrant/myapp:$PATH #Railsアプリのディレクトリを指定したい。
この記述でENV['RAILS_ROOT']に対応するものなのでしょうか?
ENV['RAILS_ROOT']に対応するように環境変数の設定をしたいのです。
ど素人レベルの質問で大変申し訳ございませんが、ご教示の程よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。