【问题标题】:Identify error Paperclip and Imagemagick识别错误回形针和 Imagemagick
【发布时间】:2012-08-04 03:59:29
【问题描述】:

我最近升级到 osx 10.8 (Mtn Lion),现在我遇到了 Imagemagick 问题。尝试上传文件时出现以下错误:

Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.>
Command :: identify -format %wx%h '/var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg[0]'
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /var/folders/nd/1cw0mqzj0nb3jv8psz_ht9cr0000gn/T/2011Spring20120803-530-2nr1jn.jpg is not recognized by the 'identify' command.>

我卸载/重新安装了自制软件和 imagemagick。我什至添加了 rmagick gem(我以前不需要),但仍然出现上述错误。

brew install imagemagick
Error: imagemagick-6.7.7-6 already installed

这是 brew doctor 输出:

brew doctor
Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
Warning: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
  cd /usr/local && git reset --hard
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

xml2-config
xmlcatalog
xmllint
xslt-config
xsltproc

Consider amending your PATH so that /usr/local/bin
occurs before /usr/bin in your PATH.

我什至在我的 config/environments/development.rb 文件中添加了以下内容

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

我再次卸载了 Imagemagick 并重新安装了它。现在我收到以下链接错误。

==> Installing imagemagick dependency: jpeg
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://www.ijg.org/files/jpegsrc.v8d.tar.gz
Already downloaded: /Library/Caches/Homebrew/jpeg-8d.tar.gz
==> ./configure --prefix=/usr/local/Cellar/jpeg/8d
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link jpeg'
==> Summary
/usr/local/Cellar/jpeg/8d: 18 files, 1.3M, built in 16 seconds
==> Installing imagemagick dependency: libtiff
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
==> Downloading http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/libtiff-4.0.2.tar.gz
==> ./configure --prefix=/usr/local/Cellar/libtiff/4.0.2
==> make install
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link libtiff'
==> Summary
/usr/local/Cellar/libtiff/4.0.2: 241 files, 3.6M, built in 24 seconds
Error: You must `brew link jpeg' before little-cms can be installed

当我输入 brew link jpeg

Error: No such file or directory - /usr/local/Cellar/jpeg/8c

当我输入 brew link libtiff 时

Error: No such file or directory - /usr/local/Cellar/libtiff/3.9.5

总之,这些链接正在寻找旧版本的 jpeg(8c 而不是 8d)和 libtiff(3.9.5 而不是 4.0.2)

关于如何解决这个问题的任何想法?

【问题讨论】:

  • 这看起来非常相似:stackoverflow.com/questions/9537011/…
  • 我重新安装了开发者工具,甚至安装了最新版本的xcode 4.4
  • 很抱歉没有在家里使用 Mac,所以帮不上忙。依稀记得有个朋友也有类似的问题,下次跟她聊天说不定能挖点东西。

标签: ruby-on-rails-3 imagemagick paperclip


【解决方案1】:

我终于能够用 2 个命令修复它。简单的符号链接,看起来很hackish...

jpeg 修复

cd /usr/local/Cellar/jpeg

ln -s 8d 8c

libtiff 修复

/usr/local/Cellar/libtiff

ln -s 4.0.2 3.9.5

【讨论】:

  • 在无法链接或取消链接 pkg-config 使用:brew link pkg-config 我做了同样的事情:/usr/local/Cellar/pkg-config ln -s 0.27 0.25
猜你喜欢
  • 1970-01-01
  • 2012-09-27
  • 2011-06-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多