Help us understand the problem. What is going on with this article?

Rails で Missing 'secret_key_base' 真っ白な画面

More than 1 year has passed since last update.

Ruby on Rails で開発中のプロジェクトに中途から参加.

【環境】
- Ruby 2.3.1
- Rails 5.0.1

.ova ファイルをもらい VirtualBox にインポートして rails を起動すると,
192.168.56.102:3000 にて,エラーメッセージ

Puma caught this error: Missing 'secret_key_base' for > 'development' environment, set this value in 'config/secrets.yml' (RuntimeError)

と共に以下の真っ白な画面が出た.

20170209_RoR_SecretKeyError.png

config/secrets.yml
が存在していなかったので作成する.
中身は他のプロジェクトからコピペした.

config/secrets.yml
development:
 secret_key_base:  8***7

test:
 secret_key_base:  3***e

production:
 secret_key_base:  <%= ENV["SECRET_KEY_BASE"] %>

これで無事に起動した.

20170209_RoR_SecretKeyErrorSolved.png

ちなみに Puma は,Production 環境で nginx と併せ使うためレポジトリに含まれているが,ローカル開発環境では未使用.

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away