9
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

key must be 32 bytes

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にさげるとうまく行く場合があるとのこと

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
Sign upLogin
9
Help us understand the problem. What are the problem?