[Heroku] Cloudinary 환경에서 Carrierwave로 이미지 업로드
4932 단어 경 6초보자Rails프로그래밍 공부 일기
프로그래밍 공부 일기
2020년 8월 9일 Progate Lv.226
마지막 기사 에 계속해서 Heroku를 취급한다.
전회까지 Rails 어플리케이션을 Heroku상에서 공개할 수 있었다.
목표
이번은 벌써 로컬로 CarrierWave를 이용해 화상의 투고를 할 수 있으므로, 그것을 Heroku상에서도 할 수 있도록 한다.
현재 Cloudinary 환경에서 Carrierwave에서 이미지를 업로드하려고하면 다음 오류가 발생합니다.
We're sorry, but something went wrong.
"If you are the application owner check the los for more information."

방법
0.5. Heroku에 신용카드 등록
Cloudinary와 연계하기 위해서는 신용카드를 등록할 필요가 있다. (무료로 할 수 있다)
여기 에서 로그인합니다. 다음 절차에 따라 신용 카드를 등록합니다.
1. Account Settings를 클릭

2. Billing 탭을 클릭하고 Add Credit Card를 클릭합니다.

3. 카드 정보 등록

1. Heroku와 Cloudinary와 협력
Heroku와 Cloudinary를 연대하기 위한 애드온(추가 기능)을 추가한다. Heroku의 브라우저에서도 명령에서도 추가할 수 있다.
명령으로 추가하는 경우
터미널$ heroku addons:add cloudinary:starter
브라우저에서 추가하는 경우
여기 에서 등록한다.
1. Install Cloudinary를 클릭합니다.

2. Add to provisio to에 서비스 이름을 입력하고 Provision add-on을 클릭합니다.

2. 업로더 파일 편집
이 업로더 파일은 Carrieawave를 사용하여 이미지를 업로드하기위한 설정 파일입니다.
업로더 (app/uploaders/image_uploader.rb)#変更前
if Rails.env.production?
include Cloudinary::CarrierWave
CarrierWave.configure do |config|
config.cache_storage = :file
end
else
storage :file
end
#変更後
#if Rails.env.production?
include Cloudinary::CarrierWave
#CarrierWave.configure do |config|
#config.cache_storage = :file
#end
#else
#storage :file
#end
감상
Rails의 버전이 5.1.7이므로 버전을 업데이트하거나 master.key를 사용해 보거나 Gemfile을 변경하거나 뷰 파일을 변경해 보거나 다양한 일을 했지만 클레카 등록이 필요 이었다.
처음에 터미널에서 heroku addons:add cloudinary:starter
를 실행했을 때 영어 문장을 제대로 읽지 않고 신용 카드를 등록해야 했음에도 불구하고 그것을 날려 버린 것이 큰 원인이었습니다. .
기본적으로는 로컬로 Cloudinary와 CarrierWave를 이용해 이미지를 투고하는 기능이 되어 있다면 위와 같이 하면 Heroku상에서 문제없이 움직였다.
여기까지 하는데 많은 시간을 보냈지만 공부가 되었다.
참고문헌
Heroku + Cloudinary 환경에서 Carrierwave로 이미지 업로드
We're sorry, but something went wrong.If you are the application owner check the logs for more information.
Reference
이 문제에 관하여([Heroku] Cloudinary 환경에서 Carrierwave로 이미지 업로드), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/mzmz__02/items/21787dcb90ca91bcbe98
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
이번은 벌써 로컬로 CarrierWave를 이용해 화상의 투고를 할 수 있으므로, 그것을 Heroku상에서도 할 수 있도록 한다.
현재 Cloudinary 환경에서 Carrierwave에서 이미지를 업로드하려고하면 다음 오류가 발생합니다.
We're sorry, but something went wrong.
"If you are the application owner check the los for more information."

방법
0.5. Heroku에 신용카드 등록
Cloudinary와 연계하기 위해서는 신용카드를 등록할 필요가 있다. (무료로 할 수 있다)
여기 에서 로그인합니다. 다음 절차에 따라 신용 카드를 등록합니다.
1. Account Settings를 클릭

2. Billing 탭을 클릭하고 Add Credit Card를 클릭합니다.

3. 카드 정보 등록

1. Heroku와 Cloudinary와 협력
Heroku와 Cloudinary를 연대하기 위한 애드온(추가 기능)을 추가한다. Heroku의 브라우저에서도 명령에서도 추가할 수 있다.
명령으로 추가하는 경우
터미널$ heroku addons:add cloudinary:starter
브라우저에서 추가하는 경우
여기 에서 등록한다.
1. Install Cloudinary를 클릭합니다.

2. Add to provisio to에 서비스 이름을 입력하고 Provision add-on을 클릭합니다.

2. 업로더 파일 편집
이 업로더 파일은 Carrieawave를 사용하여 이미지를 업로드하기위한 설정 파일입니다.
업로더 (app/uploaders/image_uploader.rb)#変更前
if Rails.env.production?
include Cloudinary::CarrierWave
CarrierWave.configure do |config|
config.cache_storage = :file
end
else
storage :file
end
#変更後
#if Rails.env.production?
include Cloudinary::CarrierWave
#CarrierWave.configure do |config|
#config.cache_storage = :file
#end
#else
#storage :file
#end
감상
Rails의 버전이 5.1.7이므로 버전을 업데이트하거나 master.key를 사용해 보거나 Gemfile을 변경하거나 뷰 파일을 변경해 보거나 다양한 일을 했지만 클레카 등록이 필요 이었다.
처음에 터미널에서 heroku addons:add cloudinary:starter
를 실행했을 때 영어 문장을 제대로 읽지 않고 신용 카드를 등록해야 했음에도 불구하고 그것을 날려 버린 것이 큰 원인이었습니다. .
기본적으로는 로컬로 Cloudinary와 CarrierWave를 이용해 이미지를 투고하는 기능이 되어 있다면 위와 같이 하면 Heroku상에서 문제없이 움직였다.
여기까지 하는데 많은 시간을 보냈지만 공부가 되었다.
참고문헌
Heroku + Cloudinary 환경에서 Carrierwave로 이미지 업로드
We're sorry, but something went wrong.If you are the application owner check the logs for more information.
Reference
이 문제에 관하여([Heroku] Cloudinary 환경에서 Carrierwave로 이미지 업로드), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/mzmz__02/items/21787dcb90ca91bcbe98
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
$ heroku addons:add cloudinary:starter
#変更前
if Rails.env.production?
include Cloudinary::CarrierWave
CarrierWave.configure do |config|
config.cache_storage = :file
end
else
storage :file
end
#変更後
#if Rails.env.production?
include Cloudinary::CarrierWave
#CarrierWave.configure do |config|
#config.cache_storage = :file
#end
#else
#storage :file
#end
Rails의 버전이 5.1.7이므로 버전을 업데이트하거나 master.key를 사용해 보거나 Gemfile을 변경하거나 뷰 파일을 변경해 보거나 다양한 일을 했지만 클레카 등록이 필요 이었다.
처음에 터미널에서
heroku addons:add cloudinary:starter
를 실행했을 때 영어 문장을 제대로 읽지 않고 신용 카드를 등록해야 했음에도 불구하고 그것을 날려 버린 것이 큰 원인이었습니다. .기본적으로는 로컬로 Cloudinary와 CarrierWave를 이용해 이미지를 투고하는 기능이 되어 있다면 위와 같이 하면 Heroku상에서 문제없이 움직였다.
여기까지 하는데 많은 시간을 보냈지만 공부가 되었다.
참고문헌
Heroku + Cloudinary 환경에서 Carrierwave로 이미지 업로드
We're sorry, but something went wrong.If you are the application owner check the logs for more information.
Reference
이 문제에 관하여([Heroku] Cloudinary 환경에서 Carrierwave로 이미지 업로드), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/mzmz__02/items/21787dcb90ca91bcbe98
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여([Heroku] Cloudinary 환경에서 Carrierwave로 이미지 업로드), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/mzmz__02/items/21787dcb90ca91bcbe98텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)