質問編集履歴

7

変更

2024/04/08 10:23

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -95,7 +95,7 @@
95
95
  - ja.errors.attributes.email.taken
96
96
  - ja.errors.messages.taken
97
97
  ```
98
- ・https://qiita.com/ta-iga/items/ecf22491700e3d67e7feの記事を参考にしてみた結果
98
+ ・https://qiita.com/ta-iga/items/ecf22491700e3d67e7fe の記事を参考にしてみた結果
99
99
  ```
100
100
  ec2-user:~/environment/* (main) $ rails db:seed
101
101
  Running via Spring preloader in process 20807

6

追記

2024/04/08 10:22

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -95,6 +95,21 @@
95
95
  - ja.errors.attributes.email.taken
96
96
  - ja.errors.messages.taken
97
97
  ```
98
+ ・https://qiita.com/ta-iga/items/ecf22491700e3d67e7feの記事を参考にしてみた結果
99
+ ```
100
+ ec2-user:~/environment/* (main) $ rails db:seed
101
+ Running via Spring preloader in process 20807
102
+ rake aborted!
103
+ ActiveRecord::RecordInvalid: バリデーションに失敗しました: Genres Translation missing. Options considered were:
104
+ - ja.activerecord.errors.models.shop.attributes.genres.blank
105
+ - ja.activerecord.errors.models.shop.blank
106
+ - ja.activerecord.errors.messages.blank
107
+ - ja.errors.attributes.genres.blank
108
+ - ja.errors.messages.blank
109
+ ```
110
+ 管理者のメルアドとパスワードを書き換えた結果、管理者のエラーが消えました!
111
+ 同じようなことをしたら上記5つのエラーは消えるかもですが、お店のデータを入れているため内容はそのままでいきたいです。
112
+ seeds.rbファイルを一度削除して作り直しても同じエラーが発生します。
98
113
 
99
114
 
100
115
 

5

追記

2024/04/08 09:44

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -75,8 +75,7 @@
75
75
  rake aborted!
76
76
  ActiveRecord::RecordInvalid: Translation missing: ja.activerecord.errors.messages.record_invalid
77
77
  ```
78
- ・app/config/locales/devise.ja.ymlに日本語設定追加
78
+ ・app/config/locales/ja.ymlに日本語設定追加
79
- 下記を上記ファイルに挿入し、実行しましたが変わりませんでした。
80
79
  ```
81
80
  ja:
82
81
  activerecord:
@@ -84,74 +83,17 @@
84
83
  messages:
85
84
  record_invalid: "バリデーションに失敗しました: %{errors}"
86
85
  ```
87
-
88
-
89
- ### 追
86
+ エラー内容です
90
- ・app/config/locales/devise.ja.ymlのファイルの内容
91
87
  ```
92
- ja:
93
- errors:
94
- messages:
95
- not_found: "は見つかりませんでした"
96
- # not_found: "not found"
97
- already_confirmed: "は既に登録済みです"
98
- # already_confirmed: "was already confirmed"
88
+ c2-user:~/environment/* (main) $ rails db:seed
99
- not_locked: "は凍結されていません"
100
- # not_locked: "was not locked"
101
-
102
- devise:
103
- failure:
104
- unauthenticated: 'ログインしてください。'
105
- # unauthenticated: 'You need to sign in or sign up before continuing.'
106
- unconfirmed: '本登録を行ってください。'
107
- # unconfirmed: 'You have to confirm your account before continuing.'
108
- locked: 'あなたのアカウントは凍結されています。'
109
- # locked: 'Your account is locked.'
110
- invalid: 'メールアドレスかパスワードが違います。'
111
- # invalid: 'Invalid email or password.'
112
- invalid_token: '認証キーが不正です。'
113
- # invalid_token: 'Invalid authentication token.'
114
- timeout: 'セッションがタイムアウトしました。もう一度ログインしてください。'
115
- # timeout: 'Your session expired, please sign in again to continue.'
116
- inactive: 'アカウントがアクティベートされていません。'
117
- # inactive: 'Your account was not activated yet.'
118
- sessions:
119
- signed_in: 'ログインしました。'
120
- # signed_in: 'Signed in successfully.'
89
+ Running via Spring preloader in process 7667
121
- signed_out: 'ログアウトしました。'
122
- # signed_out: 'Signed out successfully.'
123
- passwords:
90
+ rake aborted!
124
- send_instructions: 'パスワードのリセット方法を数分以内にメールでご連絡します。'
125
- # send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
126
- updated: 'パスワードを変更しました。'
127
- # updated: 'Your password was changed successfully. You are now signed in.'
128
- confirmations:
129
- send_instructions: '登録方法を数分以内にメールでご連絡します。'
130
- # send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
131
- confirmed: 'アカウントを登録しました。'
132
- # confirmed: 'Your account was successfully confirmed. You are now signed in.'
91
+ ActiveRecord::RecordInvalid: バリデーションに失敗しました: Email Translation missing. Options considered were:
133
- registrations:
134
- signed_up: 'アカウント登録を受け付けました。'
135
- # signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.'
136
- updated: 'アカウントを更新しました。'
137
- # updated: 'You updated your account successfully.'
92
+ - ja.activerecord.errors.models.admin.attributes.email.taken
138
- destroyed: 'アカウントを削除しました。またのご利用をお待ちしております。'
139
- # destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
140
- unlocks:
141
- send_instructions: 'アカウントの凍結解除方法を数分以内にメールでご連絡します。'
142
- # send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
143
- unlocked: 'アカウントを凍結解除しました。'
144
- # unlocked: 'Your account was successfully unlocked. You are now signed in.'
145
- mailer:
146
- confirmation_instructions:
147
- subject: 'アカウントの登録方法'
148
- # subject: 'Confirmation instructions'
149
- reset_password_instructions:
150
- subject: 'パスワードの再設定'
151
- # subject: 'Reset password instructions'
152
- unlock_instructions:
153
- subject: 'アカウントの凍結解除'
154
- # subject: 'Unlock Instructions'
93
+ - ja.activerecord.errors.models.admin.taken
94
+ - ja.activerecord.errors.messages.taken
95
+ - ja.errors.attributes.email.taken
96
+ - ja.errors.messages.taken
155
97
  ```
156
98
 
157
99
 

4

追記

2024/04/08 08:16

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -75,6 +75,16 @@
75
75
  rake aborted!
76
76
  ActiveRecord::RecordInvalid: Translation missing: ja.activerecord.errors.messages.record_invalid
77
77
  ```
78
+ ・app/config/locales/devise.ja.ymlに日本語設定追加
79
+ 下記を上記ファイルに挿入し、実行しましたが変わりませんでした。
80
+ ```
81
+ ja:
82
+ activerecord:
83
+ errors:
84
+ messages:
85
+ record_invalid: "バリデーションに失敗しました: %{errors}"
86
+ ```
87
+
78
88
 
79
89
  ### 追記
80
90
  ・app/config/locales/devise.ja.ymlのファイルの内容

3

ymlファイル追記

2024/04/08 06:24

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -76,9 +76,77 @@
76
76
  ActiveRecord::RecordInvalid: Translation missing: ja.activerecord.errors.messages.record_invalid
77
77
  ```
78
78
 
79
+ ### 追記
80
+ ・app/config/locales/devise.ja.ymlのファイルの内容
81
+ ```
82
+ ja:
83
+ errors:
84
+ messages:
85
+ not_found: "は見つかりませんでした"
86
+ # not_found: "not found"
87
+ already_confirmed: "は既に登録済みです"
88
+ # already_confirmed: "was already confirmed"
89
+ not_locked: "は凍結されていません"
90
+ # not_locked: "was not locked"
91
+
92
+ devise:
93
+ failure:
94
+ unauthenticated: 'ログインしてください。'
95
+ # unauthenticated: 'You need to sign in or sign up before continuing.'
96
+ unconfirmed: '本登録を行ってください。'
97
+ # unconfirmed: 'You have to confirm your account before continuing.'
98
+ locked: 'あなたのアカウントは凍結されています。'
99
+ # locked: 'Your account is locked.'
100
+ invalid: 'メールアドレスかパスワードが違います。'
101
+ # invalid: 'Invalid email or password.'
102
+ invalid_token: '認証キーが不正です。'
103
+ # invalid_token: 'Invalid authentication token.'
104
+ timeout: 'セッションがタイムアウトしました。もう一度ログインしてください。'
105
+ # timeout: 'Your session expired, please sign in again to continue.'
106
+ inactive: 'アカウントがアクティベートされていません。'
107
+ # inactive: 'Your account was not activated yet.'
108
+ sessions:
109
+ signed_in: 'ログインしました。'
110
+ # signed_in: 'Signed in successfully.'
111
+ signed_out: 'ログアウトしました。'
112
+ # signed_out: 'Signed out successfully.'
113
+ passwords:
114
+ send_instructions: 'パスワードのリセット方法を数分以内にメールでご連絡します。'
115
+ # send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
116
+ updated: 'パスワードを変更しました。'
117
+ # updated: 'Your password was changed successfully. You are now signed in.'
118
+ confirmations:
119
+ send_instructions: '登録方法を数分以内にメールでご連絡します。'
120
+ # send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
121
+ confirmed: 'アカウントを登録しました。'
122
+ # confirmed: 'Your account was successfully confirmed. You are now signed in.'
123
+ registrations:
124
+ signed_up: 'アカウント登録を受け付けました。'
125
+ # signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.'
126
+ updated: 'アカウントを更新しました。'
127
+ # updated: 'You updated your account successfully.'
128
+ destroyed: 'アカウントを削除しました。またのご利用をお待ちしております。'
129
+ # destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
130
+ unlocks:
131
+ send_instructions: 'アカウントの凍結解除方法を数分以内にメールでご連絡します。'
132
+ # send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
133
+ unlocked: 'アカウントを凍結解除しました。'
134
+ # unlocked: 'Your account was successfully unlocked. You are now signed in.'
135
+ mailer:
136
+ confirmation_instructions:
137
+ subject: 'アカウントの登録方法'
138
+ # subject: 'Confirmation instructions'
139
+ reset_password_instructions:
140
+ subject: 'パスワードの再設定'
141
+ # subject: 'Reset password instructions'
142
+ unlock_instructions:
143
+ subject: 'アカウントの凍結解除'
144
+ # subject: 'Unlock Instructions'
145
+ ```
79
146
 
80
147
 
81
148
 
82
149
 
83
150
 
84
151
 
152
+

2

追記

2024/04/07 14:16

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -61,7 +61,8 @@
61
61
  プレビューにもseedファイルの内容はありませんでした。
62
62
 
63
63
  ### 試したこと
64
+ ・EC2の再起動
64
- 他記事で見たrake db:dropから始まるのをやって見ましたが、改善されませんでした。
65
+ 他記事で見たrake db:dropから始まるのをやって見ましたが、改善されませんでした。
65
66
  ```
66
67
  ec2-user:~/environment/* (main) $ rake db:drop
67
68
  Dropped database 'db/development.sqlite3'

1

追記

2024/04/07 14:14

投稿

pag_jiro
pag_jiro

スコア10

test CHANGED
File without changes
test CHANGED
@@ -60,9 +60,24 @@
60
60
  ```
61
61
  プレビューにもseedファイルの内容はありませんでした。
62
62
 
63
+ ### 試したこと
64
+ 他記事で見たrake db:dropから始まるのをやって見ましたが、改善されませんでした。
65
+ ```
66
+ ec2-user:~/environment/* (main) $ rake db:drop
67
+ Dropped database 'db/development.sqlite3'
68
+ Dropped database 'db/test.sqlite3'
69
+ ec2-user:~/environment/* (main) $ rake db:create
70
+ Created database 'db/development.sqlite3'
71
+ Created database 'db/test.sqlite3'
72
+ ec2-user:~/environment/*(main) $ rake db:schema:load
73
+ ec2-user:~/environment/* (main) $ rake db:seed
74
+ rake aborted!
75
+ ActiveRecord::RecordInvalid: Translation missing: ja.activerecord.errors.messages.record_invalid
76
+ ```
63
77
 
64
78
 
65
79
 
66
80
 
67
81
 
68
82
 
83
+