Rails paperclip `not recognized by 'ident' command

I get an error when trying to save png in a model with paperclip application.

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 

Icon installation example:

 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 several people who have sent similar questions to this, especially this one , but none of these solutions work for me.

My command_path parameter is set correctly:

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

In development.rb

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

This can still be a problem. When I try to use `authentication 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 on what's going on here?

I tried reinstalling ImageMagick

 brew unlink imagemagick brew install imagemagick 

Others recommended adding Rmagick . This is definitely not a prerequisite for using Paperclip, and it also did not help.

Another solution that has been proposed is to remove the :style property. However, this is not a solution. I need to do image processing.

I have a Paperclip working on another model in my project that processes documents that are not images / do not do any processing. Therefore, I know that this is probably related to this.

Any other suggestions to solve this?

+4
source share
4 answers

As a result, the solution was installed by libtool . It was the best offer here . My problem turned out to be more complicated due to the fact that homebrew not updating and was in a state where it could not be updated without a forced check of the wizard.

For people who face this problem in the future, I recommend manually checking that the identify command really works, even if it is in your way.

 identify /path/to/some/image 

If this fails, 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 work, make sure you have the latest Xcode installed and try updating it again.

You will find out that 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 work very well. I did not watch this installer.

+4
source

This is a problem installing ImageMagick.

Try first

 brew update brew upgrade imagemagick 

If this does not work, use the magick-installer script to solve this problem: https://github.com/maddox/magick-installer

 curl https://raw.github.com/maddox/magick-installer/master/magick-installer.sh | sh 

Alternatively, use the installer magic plug with newer versions of the dependent libraries:

 curl https://raw.github.com/GTSouza/magick-installer/master/magick-installer.sh | sh 
+9
source

This may be caused by using older versions of Paperclip with newer and incompatible versions of the Cocaine gem. You can update the paperclip gem version using bundle update paperclip . He will update the paperclip and cocaine versions according to compatibility.

https://github.com/thoughtbot/paperclip/issues/1038

0
source

I just ran into this problem after upgrading to Mavericks on my Mac.

Here are the steps that fixed the problem:

 brew update brew install libtool brew link libtool brew upgrade imagemagick 
0
source

Source: https://habr.com/ru/post/1444010/


All Articles