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

  • SEARCH
  • Home
  • 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 8786385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:36:39+00:00 2026-06-13T21:36:39+00:00

I am getting an error when trying to save a png to a model

  • 0

I am getting an error when trying to save a png to a model with a paperclip attachment.

My User model:

class User < ActieRecord::Base
  attr_accessible :icon
  has_attached_file :icon, :url => "/system/users/icon/:hash.:extension",
    :hash_secret => "superSecretHashSecret",
    :styles => { :medium => "300x300>", :thumb => "100x100>" }
end

Example of trying to set an icon:

u = User.last
u.icon = open(Rails.root + "spec/fixtures/files/example.png")
u.save

Example model error:

:icon => ["/var/folders/43/810gn/T/example20121104-36855-1v7t136.png is not recognized by the 'identify' command."]

There are a number of people who have posted similar questions to this one, especially this one but none of those solutions work for me.

My command_path is set correctly:

O:~ $ which identify
/usr/local/bin/identify

In development.rb

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

This still might be the problem though.
When trying to use `identify directly I get the following error:

O:~ $ identify workspace/app/spec/fixtures/files/example.png 
dyld: Library not loaded: /usr/lib/libltdl.7.dylib
  Referenced from: /usr/local/bin/identify
  Reason: image not found
Trace/BPT trap: 5

Any suggestions as to what is going on here?

I have tried reinstalling ImageMagick

brew unlink imagemagick
brew install imagemagick

Others have recommended adding Rmagick. It is definitely not a requirement for using Paperclip and it also did not help.

Another solution that has been suggested is removing the :style property. That isn’t a solution though. I need to do the processing on the images.

I have Paperclip working on another model in my project that handles documents that are not images/don’t do any processing. So I know that it is probably related to that.

Any other suggestions on how to address this problem?

  • 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-06-13T21:36:42+00:00Added an answer on June 13, 2026 at 9:36 pm

    The solution ended up being to install libtool. This was the best suggestion here as well. My issue proved more complicated because of homebrew not being up to date and in a state where it could not be updated without forcing a checkout of master.

    For people that face this issue in the future, I recommend manually checking that the identify command actually works even if it is in your path.

    identify /path/to/some/image
    

    If it fails it will show something like:

    O:~ $ identify workspace/app/spec/fixtures/files/example.png 
    dyld: Library not loaded: /usr/lib/libltdl.7.dylib
      Referenced from: /usr/local/bin/identify
      Reason: image not found
    Trace/BPT trap: 5
    

    In this case try installing libtool.

    brew install libtool
    

    If this fails, run brew update. If it continues to fail ensure that you have the latest Xcode installed and try updating again.

    You will know this worked if you can successfully use identity. It will look something like this:

    O:~ $ identify ~/workspace/app/spec/fixtures/files/example.png 
    ~/workspace/app/spec/fixtures/files/example.png PNG 200x201 200x201+0+0 8-bit DirectClass 66.1KB 0.000u 0:00.000
    

    The answer from glebm may very well have worked too. I have not taken a look at that installer.

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

Sidebar

Related Questions

i am getting this error while trying to save data into model in db.
I am getting the following error when trying to save a file to disk:
I'm getting 'Can't mass-assign protected attribute' error when trying to save a form that
I am trying to save images in Django and getting the error The ImageOps
I'm getting this error when trying to save a file in Xcode 4: The
I'm getting the error: undefined method `model_name' for NilClass:Class when trying to call the
I'm getting this error when trying to serialize a class: There was an error
Hello I'm getting this error, while trying to save serial number to XML File.
I am getting the below error and stack trace while trying to save/create a
I am getting error trying to run my asp code for executing stored proc.

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.