0
0

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でdeviceをカスタマイズしてたら「I18n::InvalidLocale in 〜〜」というエラーが出た

0
Posted at

■解決したいこと

RailsでWebアプリ作成で
device(ユーザー管理機能)のGemを追加したところ
サインイン画面、ログアウト画面で
「InvalidLocale in〜〜」というエラーが表示されて解決できず困った!

■経緯
deviceの
・ログアウト機能
・フラッシュメッセージ機能
の実装を進めていたらエラーが発生した。

■結論

ja.yml
devise.ja.yml
を配置しているディレクトリが間違っていた、、

誤:プロジェクト名/app/assets/stylesheets/config/
正:プロジェクト名/config/

↑上記2つのファイルはフラッシュメッセージを日本語化するためのファイル。
configディレクトリの直下に配置するものだが、
違うほうのconfigファイルに配置していた。

■自力で調べた内容

検索ワード 「InvalidLocale in 」
フラッシュメッセージの日本語化の設定に関する記事がいくつか出た。
(参照記事)
・rails sしたら[deprecated] I18n.enforce_available_locales・・・・って出てくる
https://qiita.com/katsuyuki/items/9f9f202047cdef7f11a6

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?