Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 785979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:57:52+00:00 2026-05-14T20:57:52+00:00

I’ve been searching on how to solve this issue but could not find any

  • 0

I’ve been searching on how to solve this issue but could not find any real and working solution.

User model:

validates_attachment_content_type :avatar, :content_type => [‘image/jpeg’, ‘image/pjpeg’, ‘image/x-png’, ‘image/png’, ‘image/gif’]

Unnecessary error shows up when invalid file type is uploaded:

Avatar /tmp/sample,23283,0.txt is not recognized by the 'identify' command.

Server details:
Ubuntu and Debian

which identify
results to
/usr/bin/identify

Specifying command path does not solve the issue:

Paperclip.options[:command_path] = "/usr/bin"

Any ideas?

I looked at geometry.rb file and there seems to be something wrong with it.

def self.from_file file
  file = file.path if file.respond_to? "path"
  geometry = begin
               Paperclip.run("identify", %Q[-format "%wx%h" "#{file}"[0]])
             rescue PaperclipCommandLineError
               ""
             end
  parse(geometry) ||
    raise(NotIdentifiedByImageMagickError.new("#{file} is not recognized by the 'identify' command."))
end

Let me know if anyone has solved the same issue and how. Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:57:53+00:00Added an answer on May 14, 2026 at 8:57 pm

    I’ve had the same problem – the Paperclip code is not at fault.

    In my setup I’m on MacOSX with a binary download of ImageMagick in /usr/local/ImageMagick-6.6.1/bin and I’m running Rails under Apache/Passenger. I’ve got Paperclip installed as a plugin.

    There are 3 steps needed to get this working:

    1: Make sure you have ImageMagick working at the UNIX command line level. This involves adding it to your path and exporting these environment variables (pointing to your ImageMagick installation, of course)

    MAGICK_HOME=/usr/local/ImageMagick-6.6.1
    DYLD_LIBRARY_PATH=/usr/local/ImageMagick-6.6.1/lib
    

    Check that identify works with your images at the command line level.

    2: Tell Paperclip where to find the ImageMagick executables
    In config/environment.rb add this at the bottom of the file

    Paperclip.options[:command_path] = "/usr/local/ImageMagick-6.6.1/bin"
    

    At this point, after restarting Passenger, you would see that ‘identify’ is run from within Paperclip but is not able to identify the file… the final step is…

    3: Identify needs those two exported environment variables – and Apache/Passenger (or other web servers probably) does not pass those through by default!
    In your passenger vhost file add these lines:

      SetEnv MAGICK_HOME /usr/local/ImageMagick-6.6.1
      SetEnv DYLD_LIBRARY_PATH /usr/local/ImageMagick-6.6.1/lib
    

    Restart apache/passenger and it should work

    Good Luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a jquery bug and I've been looking for hours now, I can't
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I want to count how many characters a certain string has in PHP, but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.