15
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

15
8
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
  3. You can use dark theme
What you can do with signing up
15
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?