LoginSignup
0
0

More than 5 years have passed since last update.

久しぶりにPaperclip x Cloudinary使って詰まったので、メモ残す

Posted at

はじめに

RailsにPaperclip x Cloudinaryを久々に導入したのですが、エラーでいろいろ詰まってしまったので、その時のメモを残そう。
ちなみにgem 'paperclip-cloudinary'も使っています。

Paperclip::Errors::InfiniteInterpolationError

パス指定しないとこのエラーが出るようです。

article.rb
has_attached_file :image,
:path => ':id/:style/:filename'

Invalid image file

avatarのimageだけで使う場合は問題ないと思いますが、
mp3、mp4のような形だと引っかかる可能性があるので、気をつけましょう。

mp3の場合
has_attached_file :mp3, 
:cloudinary_resource_type => :raw

mp3の場合はraw指定で試して本番環境の動作確認もできました。(もしかしたら、audioでもいけるかも、、)
他のxlsといった形式もrawのようです。

mp4の場合
 has_attached_file :mp4,
:cloudinary_resource_type => :video

参照

Raw file uploading
Paperclip::Errors::InfiniteInterpolationError #1

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0