teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

詳細情報付加

2016/07/20 06:41

投稿

hrc
hrc

スコア55

title CHANGED
File without changes
body CHANGED
@@ -59,4 +59,60 @@
59
59
  また特にログ上はエラーが出ていないのですが、そもそもファイルが上がらないようです。
60
60
  フォームからのアップロード直後にtmp/filesには画像ファイルは上がっていませんでした。
61
61
 
62
- File.openのあたりがダメなのかなとはわかっているのですが、手がかりがなく途方に暮れています。どなたかよろしくお願いします。
62
+ File.openのあたりがダメなのかなとはわかっているのですが、手がかりがなく途方に暮れています。どなたかよろしくお願いします。
63
+
64
+ 【追記】EC2のディレクトリ状況
65
+
66
+ ```csh
67
+ [ec2-user@ip-172-31-8-184 current]$ ls
68
+ Gemfile README.rdoc app bin config.ru lib public tmp
69
+ Gemfile.lock Rakefile area_id config db log test vendor
70
+ [ec2-user@ip-172-31-8-184 current]$ cd tmp
71
+ [ec2-user@ip-172-31-8-184 tmp]$ ls -la
72
+ 合計 16
73
+ drwxr-xr-x 4 webapp webapp 4096 7月 20 00:46 .
74
+ drwxr-xr-x 13 webapp webapp 4096 7月 20 00:46 ..
75
+ drwxr-xr-x 3 webapp webapp 4096 7月 20 00:44 cache
76
+ drwxr-xr-x 2 webapp webapp 4096 7月 20 06:25 files
77
+ [ec2-user@ip-172-31-8-184 tmp]$ pwd
78
+ /var/app/current/tmp
79
+ ```
80
+
81
+ log/production.logの抜粋はこちらです。
82
+
83
+ ```log
84
+ I, [2016-07-20T06:25:32.056814 #22912] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"VeWAmjaeUgNtASnWcPmJgWikufWhfZc5XVKwCmAjQ2zlXWbQRaieWKhbh9N32TN7A9wS9btqOyHHtF6xgtSyDA==", "review"=>{"title"=>"test0720 1525", "food_rating"=>"1", "decor_rating"=>"1", "service_rating"=>"1", "comment"=>"hahahah", "file"=>#<ActionDispatch::Http::UploadedFile:0x007f2bf50dd900 @tempfile=#<Tempfile:/tmp/RackMultipart20160720-22912-vflx9p.png>, @original_filename="スコア履歴詳細0720.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"review[file]\"; filename=\"\xE3\x82\xB9\xE3\x82\xB3\xE3\x82\xA2\xE5\xB1\xA5\xE6\xAD\xB4\xE8\xA9\xB3\xE7\xB4\xB00720.png\"\r\nContent-Type: image/png\r\n">, "restaurant_id"=>"26", "user_id"=>"8"}, "commit"=>"Create Review", "locale"=>"en"}
85
+ D, [2016-07-20T06:25:32.060935 #22912] DEBUG -- : ^[[1m^[[36m (0.7ms)^[[0m ^[[1mBEGIN^[[0m
86
+ D, [2016-07-20T06:25:32.090755 #22912] DEBUG -- : ^[[1m^[[35mSQL (27.8ms)^[[0m INSERT INTO `reviews` (`restaurant_id`, `user_id`, `food_rating`, `decor_rating`, `service_rating`, `title`, `comment`, `image1`, `created_at`, `updated_at`) VALUES (26, 8, 1, 1, 1, 'test0720 1525', 'hahahah', 'review/894a32b74b99b14a55d2d0d4ea44c511.png', '2016-07-20 06:25:32', '2016-07-20 06:25:32')
87
+ I, [2016-07-20T06:25:32.768627 #22912] INFO -- : Started GET "/images/review/894a32b74b99b14a55d2d0d4ea44c511.png" for 118.238.219.183 at 2016-07-20 06:25:32 +0000
88
+ F, [2016-07-20T06:25:32.770916 #22912] FATAL -- :
89
+ ActionController::RoutingError (No route matches [GET] "/images/review/894a32b74b99b14a55d2d0d4ea44c511.png"):
90
+ actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
91
+ actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
92
+ railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
93
+ railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
94
+ activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
95
+ activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
96
+ activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
97
+ railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
98
+ actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
99
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
100
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
101
+ activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware
102
+ .rb:28:in `call'
103
+ activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
104
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
105
+ railties (4.2.3) lib/rails/engine.rb:518:in `call'
106
+ railties (4.2.3) lib/rails/application.rb:165:in `call'
107
+ passenger (4.0.60) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
108
+ passenger (4.0.60) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
109
+ passenger (4.0.60) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
110
+ passenger (4.0.60) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
111
+ I, [2016-07-20T06:26:21.832915 #22912] INFO -- : Started GET "/" for 150.70.173.8 at 2016-07-20 06:26:21 +0000
112
+ I, [2016-07-20T06:26:21.835259 #22912] INFO -- : Processing by FrontpageController#index as */*
113
+ I, [2016-07-20T06:26:21.850473 #22912] INFO -- : Rendered frontpage/index.html.slim within layouts/application (8.8ms)
114
+ I, [2016-07-20T06:26:21.853794 #22912
115
+ ```
116
+
117
+ 画像がアップロードされず、app/assets/images配下にもコピー出来ないため画面上はこのようになっております。
118
+ ![no photo](96fd710094563aae891beee711b5d731.png)