実現したいこと
リリース後でも画像が表示されるようにしたい
前提
Rubyでwebアプリを開発している初心者です。
画像投稿機能を取り入れたいと考えており、Cloudinaryを使用しています。
ただ、ローカル環境は問題なく画像投稿ができるのですが、本番環境では
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
このように表示されてしまい、画像投稿ができません。
flyctl secrets set CLOUD_NAME=~
は実行しています
発生している問題・エラーメッセージ
We're sorry, but something went wrong. If you are the application owner check the logs for more information.
試したこと
環境変数の確認
flyctl secrets set CLOUD_NAME=~の再実行
補足
If you are the application owner check the logs for more information.
とあるのですから、まずそれを
ありがとうございます。
確認したところ
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info]I, [2023-06-04T14:24:50.480763 #513] INFO -- : [a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd] Parameters: {"authenticity_token"=>"[FILTERED]", "post"=>{"title"=>"naruto", "summary"=>"", "highlight"=>"", "hashbody"=>"", "image"=>#<ActionDispatch::Http::UploadedFile:0x000055f89c23dc10 @tempfile=#<Tempfile:/tmp/RackMultipart20230604-513-bjw33x.jfif>, @original_filename="R.jfif", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"post[image]\"; filename=\"R.jfif\"\r\nContent-Type: image/jpeg\r\n">, "tag_ids"=>["", "5"]}, "commit"=>"保存", "id"=>"2"}
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info]I, [2023-06-04T14:24:50.555548 #513] INFO -- : [a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd] Completed 500 Internal Server Error in 75ms (ActiveRecord: 26.4ms | Allocations: 13432)
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info]F, [2023-06-04T14:24:50.556105 #513] FATAL -- : [a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd]
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info][a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd] Errno::EACCES (Permission denied @ dir_s_mkdir - /rails/public/uploads/tmp/1685888690-513-0001-4310):
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info][a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd]
2023-06-04T14:24:50Z app[3287332a0d6d85] nrt [info][a73d5f5b-2a2e-4d04-83e9-a2faaa7ed9bd] app/controllers/posts_controller.rb:45:in `update'
このようなログになってました。
Completed 500 Internal Server Error in 75ms (ActiveRecord: 26.4ms | Allocations: 13432)と
Errno::EACCES (Permission denied @ dir_s_mkdir - /rails/public/uploads/tmp/1685888690-513-0001-4310):が今回の原因でしょうか。
上のは結果です。下のが原因
なるほど。
この場合、パーミッションの変更を行えばいいのでしょうか。
もしそうであれば、具体的な方法のご教授をお願いしたいです。

回答2件
あなたの回答
tips
プレビュー