Rails使用paperclip报CommandNotFoundError错的解决

已安装ImageMagick,但在设定了指定大小后paperclip报错:

Paperclip::Errors::CommandNotFoundError (Could not run the `identify` command. Please install ImageMagick.):
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/z2/n3vz292s0z7f995w0_bphm780000gn/T/1ce67fe3a364b6e5918d8fa96478ceef20170222-20952-1cruqw2.png[0]' 2>/dev/null

提示要你安装ImageMagick,但是前面说过已经装过了!!!

使用如下命令查看ImageMagick的信息:

brew info ImageMagick@6
ImageMagick@6: stable 6.9.7-9 (bottled) [keg-only]
Tools and libraries to manipulate images in many formats
https://www.imagemagick.org/
/usr/local/Cellar/ImageMagick@6/6.9.7-9 (1,465 files, 22.2M)
  Poured from bottle on 2017-02-22 at 18:05:21
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/imagemagick@6.rb
==> Dependencies
Build: pkg-config ✔
Required: libtool ✔, xz ✔
Recommended: jpeg ✔, libpng ✔, libtiff ✔, freetype ✔
Optional: fontconfig ✘, little-cms ✘, little-cms2 ✘, libwmf ✘, librsvg ✘, liblqr ✘, openexr ✘, ghostscript ✘, webp ✘, openjpeg ✘, fftw ✘, pango ✘
==> Requirements
Optional: perl >= 5.5 ✔
==> Options
--with-fftw
    Compile with FFTW support
--with-fontconfig
    Build with fontconfig support
--with-ghostscript
    Build with ghostscript support
--with-hdri
    Compile with HDRI support
--with-liblqr
    Build with liblqr support
--with-librsvg
    Build with librsvg support
--with-libwmf
    Build with libwmf support
--with-little-cms
    Build with little-cms support
--with-little-cms2
    Build with little-cms2 support
--with-opencl
    Compile with OpenCL support
--with-openexr
    Build with openexr support
--with-openjpeg
    Build with openjpeg support
--with-openmp
    Compile with OpenMP support
--with-pango
    Build with pango support
--with-perl
    Compile with PerlMagick
--with-quantum-depth-16
    Compile with a quantum depth of 16 bit
--with-quantum-depth-32
    Compile with a quantum depth of 32 bit
--with-quantum-depth-8
    Compile with a quantum depth of 8 bit
--with-webp
    Build with webp support
--with-zero-configuration
    Disables depending on XML configuration files
--without-freetype
    Build without freetype support
--without-jpeg
    Build without jpeg support
--without-libpng
    Build without libpng support
--without-libtiff
    Build without libtiff support
--without-magick-plus-plus
    disable build/install of Magick++
--without-modules
    Disable support for dynamically loadable modules
--without-threads
    Disable threads support
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

Older version of imagemagick

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/ImageMagick@6/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/ImageMagick@6/lib
    CPPFLAGS: -I/usr/local/opt/ImageMagick@6/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/ImageMagick@6/lib/pkgconfig

进入/usr/local/opt/ImageMagick@6/bin查看,命令都在,应该是没有加入到path中去:

echo 'export PATH="/usr/local/opt/ImageMagick@6/bin:$PATH"' >> ~/.bash_profile

现在ok了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大熊猫侯佩

赏点钱让我买杯可乐好吗 ;)

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值