8
2

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.

RailsでViewを表示しようとしたらArgumentError: key must be 32 bytes

Posted at

Railsを触ってみようと思い、RubyとRailsをインストールしてみた。
どうせなら最新版で、と思い得意気に触り始めた矢先に遭遇したエラー。

環境

Mac OS X El Capitan 10.11.4
Ruby 2.4.0dev
Rails 5.0.0.1

手順

  1. 任意のディレクトリでrails new hogeでプロジェクトを作る。
  2. cd hogeで作成したプロジェクトディレクトリに移動する。
  3. rails generate controller hello indexな感じでcontrollerとviewを作成する。
  4. rails sサーバーを起動し、localhost:3000/helloにアクセスすると表題のエラーが発生。

まだ1行もコーディングしてないのにArgumentErrorって言われましても。。。

原因

エラーメッセージで検索するとgithubのissuesがヒットした。
Ruby2.4.0にアップグレードしたらエラーが出るようになったって事ですか。

対応

自前で32bitの秘密鍵を作るのが正しいお手前なのだろうが
RubyのVersionにこだわりがある訳ではないので
rbenv local 2.2.4
前に入れて放置していたVersionに切り替えたところ想定通り画面が表示された。

8
2
0

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
8
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?