Skip to content

Instantly share code, notes, and snippets.

@wellington1993
Created March 15, 2016 11:57
Show Gist options
  • Save wellington1993/f9b598b4fdcc8f904090 to your computer and use it in GitHub Desktop.
Save wellington1993/f9b598b4fdcc8f904090 to your computer and use it in GitHub Desktop.
An unhandled lowlevel error occured. The application logs may have details.

An unhandled lowlevel error occured. The application logs may have details.

  • Rails 4.0から4.2へ移行した際のメモ

puma/pumaをサイト見たらここでエラーを出しているみたい。

=== puma startup: 2015-02-12 12:22:27 +0000 ===
=== puma startup: 2015-02-12 12:22:27 +0000 ===
[20244] - Worker 0 (pid: 20248) booted, phase: 0
2015-02-12 12:24:17 +0000: Rack app error: #<RuntimeError: Missing `secret_token` and `secret_key_base` for 'production' environment, set these values in `config/secrets.yml`>

Rails4.0までは

  • config/initializers/secret_token.rb

にsecret_tokenを入れていたが、今回から

  • config/secrets.ymlが必要になったらしい

Rails 4.1からは

  • config/secrets.yml
# config/secrets.yml
development:
  secret_key_base: XXXXXXXXXXXXXXXXXXXX

test:
  secret_key_base: XXXXXXXXXXXXXXXXXXXX

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
  • とりあえずこれで動く
$ rm config/initializers/secret_token.rb
$ export SECRET_KEY_BASE=`bundle exec rake secret`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment