0
0

【Rails】ArgumentError (Unrecognized status code :request_entity_too_large)

Posted at

はじめに

Rails7にアップデート中、request_entity_too_largeを使用している部分でエラーが発生したので、解消方法をまとめていきます。

問題

コード

render body: nil, status: :request_entity_too_large

エラー内容

Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms | Allocations: 984)

ArgumentError (Unrecognized status code :request_entity_too_large):

解決方法

Rails4.2からrequest_entity_too_largeはpayload_too_largeに変更されています。
request_entity_too_largeを使用している部分をpayload_too_largeに変更することで解消します。

render body: nil, status: :payload_too_large

参考

0
0
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
0
0