LoginSignup
7
6

More than 5 years have passed since last update.

[Rails 4.x] Staging環境作成

Posted at

本番環境の設定ができている前提です。
またPassengerを使っています。

環境設定ファイルの作成

$ cp config/environments/production.rb config/environements/staging.rb

deviseの:confirmableを設定している場合↓

$ vim config/environments/staging.rb
——
config.action_mailer.default_url_options = { :host => 'http://hoge.com' }
——

データベースの設定

$ vim config/database.yml
——
staging:
  <<: *default
  database: hoge_development
  #database: hoge_staging
  #database: hoge_production
——

apacheの設定

stagingサーバーに入ります

$ ssh STAGING_SERVER
>>> @ staging server
$ sudo vim /etc/httpd/conf/httpd.conf

RailsEnv staging

データベースのマイグレーション

$ rake db:migrate RAILS_ENV=staging
7
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
7
6