全新的Rails應用程序。Rails 5 cipher.key「key must be 32 bytes」error
Rails版本5.0.0.1,Ruby版本2.4.0preview2。
創建應用程序「演示」,運行一個簡單的支架產生的產品,並獲得試圖查看支架的概述頁面時出現錯誤(基本索引文件仍然加載歡迎Rails的畫面細膩):
引發ArgumentError中的ProductsController #INDEX 密鑰必須是32個字節:
cipher = new_cipher
cipher.encrypt
cipher.key = @secret
# Rely on OpenSSL for the initialization vector
iv = cipher.random_iv
問題線顯然cipher.key = @secret。
我見過各種提到的GitHub庫爲Rails提的這個問題,但所有的暗示它現在解決了Rails的5.0.0.1
你確定*關於'5.0.0.1',而不是'5.0.0.0'?我剛剛閱讀[此問題](https://github.com/rails/rails/issues/25185)和相關的請求;它看起來像錯誤已被修復?我會嘗試重新創建它,雖然... –
如果我運行'rails -v',我得到'Rails 5.0.0.1',並運行'gem list rails -all'顯示剛安裝的5.0.0.1 – TheMinimalCriminal
Gemfile列出'gem'rails','〜> 5.0.0','> = 5.0.0.1'' – TheMinimalCriminal