質問編集履歴
3
エラー内容の更新
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,38 +6,34 @@
|
|
6
6
|
### 発生している問題・エラーメッセージ
|
7
7
|
|
8
8
|
```
|
9
|
-
|
9
|
+
RuntimeError in MessagesController#create
|
10
|
+
|
10
|
-
|
11
|
+
Cannot load `Rails.config.active_storage.service`: Missing configuration for the :amazon Active Storage service. Configurations available for [:test, :local]
|
11
12
|
```
|
12
13
|
データベースには記入データが保存されていますが詳細ページに遷移しても画像データは表示されていません
|
13
14
|
|
14
15
|
```
|
16
|
+
Started POST "/messages" for ::1 at 2021-01-20 09:19:53 +0900
|
17
|
+
(0.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
|
15
18
|
Processing by MessagesController#create as HTML
|
16
|
-
Parameters: {"authenticity_token"=>"
|
19
|
+
Parameters: {"authenticity_token"=>"LJj60SrIJ/gF3QdWFHDEFngtOgJU2WcGyiZtrmPgzYAJO4eemjqfnIdkJu/BBHtNs+cAENC9ww/1cbmaNGbUtw==", "message_tag"=>{"title"=>"アイウエオ", "message"=>"ooooooo", "whom"=>"さしすせそ", "open_plan(1i)"=>"2025", "open_plan(2i)"=>"7", "open_plan(3i)"=>"6", "images"=>[#<ActionDispatch::Http::UploadedFile:0x00007fc1cc861790 @tempfile=#<Tempfile:/var/folders/pg/6dn2c_091hb4pfr45vz6w9fr0000gn/T/RackMultipart20210120-1154-1pq5qrm.png>, @original_filename="Railsの処理の流れ_0409.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"message_tag[images][]\"; filename=\"Rails\xE3\x81\xAE\xE5\x87\xA6\xE7\x90\x86\xE3\x81\xAE\xE6\xB5\x81\xE3\x82\x8C_0409.png\"\r\nContent-Type: image/png\r\n">], "name"=>"S3テスト"}, "commit"=>"想いを残す"}
|
17
20
|
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
|
18
|
-
(0.
|
21
|
+
(0.2ms) BEGIN
|
19
22
|
↳ app/models/message_tag.rb:21:in `save'
|
20
|
-
User Load (0.
|
23
|
+
User Load (0.2ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
|
21
24
|
↳ app/models/message_tag.rb:21:in `save'
|
22
|
-
Message Create (
|
25
|
+
Message Create (1.1ms) INSERT INTO `messages` (`title`, `whom`, `message`, `open_plan`, `user_id`, `created_at`, `updated_at`) VALUES ('アイウエオ', 'さしすせそ', 'ooooooo', '2025-07-06', 1, '2021-01-20 00:19:53.378596', '2021-01-20 00:19:53.378596')
|
23
26
|
↳ app/models/message_tag.rb:21:in `save'
|
24
|
-
ActiveStorage::Attachment Load (0.
|
27
|
+
ActiveStorage::Attachment Load (0.4ms) SELECT `active_storage_attachments`.* FROM `active_storage_attachments` WHERE `active_storage_attachments`.`record_id` = 82 AND `active_storage_attachments`.`record_type` = 'Message' AND `active_storage_attachments`.`name` = 'images'
|
25
28
|
↳ app/models/message_tag.rb:21:in `save'
|
26
|
-
|
29
|
+
(0.5ms) ROLLBACK
|
27
30
|
↳ app/models/message_tag.rb:21:in `save'
|
28
|
-
|
29
|
-
↳ app/models/message_tag.rb:21:in `save'
|
30
|
-
ActiveStorage::Attachment Load (0.3ms) SELECT `active_storage_attachments`.* FROM `active_storage_attachments` WHERE `active_storage_attachments`.`record_id` = 60 AND `active_storage_attachments`.`record_type` = 'Message' AND `active_storage_attachments`.`name` = 'video' LIMIT 1
|
31
|
-
↳ app/models/message_tag.rb:21:in `save'
|
32
|
-
Message Update (0.2ms) UPDATE `messages` SET `messages`.`updated_at` = '2021-01-19 15:09:27.624963' WHERE `messages`.`id` = 60
|
33
|
-
↳ app/models/message_tag.rb:21:in `save'
|
34
|
-
(1.3ms) COMMIT
|
35
|
-
↳ app/models/message_tag.rb:21:in `save'
|
36
|
-
Completed 500 Internal Server Error in 61ms (ActiveRecord: 3.5ms | Allocations: 14014)
|
31
|
+
Completed 500 Internal Server Error in 39ms (ActiveRecord: 2.7ms | Allocations: 32823)
|
37
32
|
|
38
33
|
|
39
34
|
|
40
|
-
|
35
|
+
RuntimeError (Cannot load `Rails.config.active_storage.service`:
|
36
|
+
Missing configuration for the :amazon Active Storage service. Configurations available for [:test, :local]):
|
41
37
|
|
42
38
|
app/models/message_tag.rb:21:in `save'
|
43
39
|
app/controllers/messages_controller.rb:17:in `create'
|
2
現状の更新
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
NoMethodError in MessagesController#create
|
10
10
|
undefined method `upload' for nil:NilClass
|
11
11
|
```
|
12
|
+
データベースには記入データが保存されていますが詳細ページに遷移しても画像データは表示されていません
|
12
13
|
|
13
14
|
```
|
14
15
|
Processing by MessagesController#create as HTML
|
1
ターミナルでの情報
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,6 +10,38 @@
|
|
10
10
|
undefined method `upload' for nil:NilClass
|
11
11
|
```
|
12
12
|
|
13
|
+
```
|
14
|
+
Processing by MessagesController#create as HTML
|
15
|
+
Parameters: {"authenticity_token"=>"X+mOZLRb58dIWhnGkYKGd9F2+fINsEstMnRk26yndjR6SvMrBKlfo8rjOH9E9jksGrzD4InU7yQNI7Dv+yFvAw==", "message_tag"=>{"title"=>"S3テ", "message"=>"S3", "whom"=>"S3テスト", "open_plan(1i)"=>"2025", "open_plan(2i)"=>"5", "open_plan(3i)"=>"5", "images"=>[#<ActionDispatch::Http::UploadedFile:0x00007fc1ba7d4e38 @tempfile=#<Tempfile:/var/folders/pg/6dn2c_091hb4pfr45vz6w9fr0000gn/T/RackMultipart20210120-1154-8t82gv.png>, @original_filename="Railsの処理の流れ_0409.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"message_tag[images][]\"; filename=\"Rails\xE3\x81\xAE\xE5\x87\xA6\xE7\x90\x86\xE3\x81\xAE\xE6\xB5\x81\xE3\x82\x8C_0409.png\"\r\nContent-Type: image/png\r\n">], "name"=>"S3テスト"}, "commit"=>"想いを残す"}
|
16
|
+
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
|
17
|
+
(0.1ms) BEGIN
|
18
|
+
↳ app/models/message_tag.rb:21:in `save'
|
19
|
+
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
|
20
|
+
↳ app/models/message_tag.rb:21:in `save'
|
21
|
+
Message Create (0.2ms) INSERT INTO `messages` (`title`, `whom`, `message`, `open_plan`, `user_id`, `created_at`, `updated_at`) VALUES ('S3テ', 'S3テスト', 'S3', '2025-05-05', 1, '2021-01-19 15:09:27.575726', '2021-01-19 15:09:27.575726')
|
22
|
+
↳ app/models/message_tag.rb:21:in `save'
|
23
|
+
ActiveStorage::Attachment Load (0.2ms) SELECT `active_storage_attachments`.* FROM `active_storage_attachments` WHERE `active_storage_attachments`.`record_id` = 60 AND `active_storage_attachments`.`record_type` = 'Message' AND `active_storage_attachments`.`name` = 'images'
|
24
|
+
↳ app/models/message_tag.rb:21:in `save'
|
25
|
+
ActiveStorage::Blob Create (0.3ms) INSERT INTO `active_storage_blobs` (`key`, `filename`, `content_type`, `metadata`, `byte_size`, `checksum`, `created_at`) VALUES ('pqp3dpr4bvq76prcc50hccr4h95m', 'Railsの処理の流れ_0409.png', 'image/png', '{\"identified\":true}', 530428, 'lfjBjfDfCL0sw1R4+RO0YQ==', '2021-01-19 15:09:27')
|
26
|
+
↳ app/models/message_tag.rb:21:in `save'
|
27
|
+
ActiveStorage::Attachment Create (0.2ms) INSERT INTO `active_storage_attachments` (`name`, `record_type`, `record_id`, `blob_id`, `created_at`) VALUES ('images', 'Message', 60, 36, '2021-01-19 15:09:27')
|
28
|
+
↳ app/models/message_tag.rb:21:in `save'
|
29
|
+
ActiveStorage::Attachment Load (0.3ms) SELECT `active_storage_attachments`.* FROM `active_storage_attachments` WHERE `active_storage_attachments`.`record_id` = 60 AND `active_storage_attachments`.`record_type` = 'Message' AND `active_storage_attachments`.`name` = 'video' LIMIT 1
|
30
|
+
↳ app/models/message_tag.rb:21:in `save'
|
31
|
+
Message Update (0.2ms) UPDATE `messages` SET `messages`.`updated_at` = '2021-01-19 15:09:27.624963' WHERE `messages`.`id` = 60
|
32
|
+
↳ app/models/message_tag.rb:21:in `save'
|
33
|
+
(1.3ms) COMMIT
|
34
|
+
↳ app/models/message_tag.rb:21:in `save'
|
35
|
+
Completed 500 Internal Server Error in 61ms (ActiveRecord: 3.5ms | Allocations: 14014)
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
NoMethodError (undefined method `upload' for nil:NilClass):
|
40
|
+
|
41
|
+
app/models/message_tag.rb:21:in `save'
|
42
|
+
app/controllers/messages_controller.rb:17:in `create'
|
43
|
+
|
44
|
+
```
|
13
45
|
### 該当のソースコード
|
14
46
|
|
15
47
|
```new.html.erb
|