Search code examples
ruby-on-railspdfrubygemspreviewpoppler

ActiveStorage::UnpreviewableError


I'm trying to create a PDF preview for my PDF files, but I don't know where to start, I'm using poppler gem on Ruby on Rails.

The app is giving me this message: "ActiveStorage::UnpreviewableError in Tasks#show"

So I'm not understanding where should I need to declare the preview

Looking on google I found several sites with methods, but I don't know where to add this code, I've tried by creating a new folder on the app directory, but this didn't work.


Solution

  • In activestorage documentation says about requirements to use this feature.

    • libvips v8.6+ (libvips package) or ImageMagick for image analysis and transformations
    • ffmpeg v3.4+ for video previews and ffprobe for video/audio analysis
    • poppler (i.e. poppler-utils package) or muPDF for PDF previews

    Check if in your environment has the requirements