LoginSignup
8

More than 5 years have passed since last update.

key must be 32 bytes

Last updated at Posted at 2017-01-21

rails 5.0.0.1を使ってアプリ作って、localhostにアクセスしたらなんかいきなりエラーが出た

ArgumentError in WelcomeController#index
key must be 32 bytes

Extracted source (around line #72):
70 cipher = new_cipher
71 cipher.encrypt
72 cipher.key = @secret
73
74 # Rely on OpenSSL for the initialization vector
75 iv = cipher.random_iv

原因はここに書いてあった

New app: "key must be 32 bits". #25185
どうやらRailsのバージョンが悪いらしい

そんなわけでGemfileに記載しているRailsのバージョンを5.0.0.1→5.0.1に変更してbundle update

すると無事にindex.htmlが表示されました

追記

Railsのバージョンが5.0.1でも同じ現象が起こる方は、Rubyのversionを2.3.1にさげるとうまく行く場合があるとのこと

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
What you can do with signing up
8