rmagick CarrierWave'无法操纵rmagick'对于pdf文件

时间:2015-11-25 09:25:24

标签: ruby-on-rails-4 carrierwave ruby-2.1

我正在尝试使用rmagick转换为pdf,但我收到错误:

[Failed to manipulate with rmagick, maybe it is not an image? Original Error: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=/tmp/magick-2797WnVJ4aTtWnrf%d" "-f/tmp/magick-2797SHrLmrQNlfJP" "-f/tmp/magick-2797RE8ma6T4j70p"' (-1) @ error/delegate.c/ExternalDelegateCommand/461]

我的ImageMagic配置:

convert -list configure
  

CONFIGURE ../../configure' - build = x86_64-linux-gnu' ' - 了includedir = $ {前缀} /包括' ' - 迪尔= $ {PREFIX} /股/人' ' - INFODIR = $ {PREFIX} /共享/信息' ' - 的localstatedir = / VAR' ' - LIBDIR = $ {前缀} / LIB / x86_64的-Linux的GNU' ' - libexecdir = $ {前缀} / LIB / x86_64的-Linux的GNU' ' - 禁用-维护者模式' ' - 禁用依赖性跟踪' ' - 前缀= / USR' ' - LIBDIR = / usr / lib中/ x86_64的-Linux的GNU' ' - SYSCONFDIR = /等' ' - 与-includearch-DIR =的/ usr /包括/ x86_64的-Linux的GNU /' ' - mandir = / usr / share / man' convert -list configure' - infodir = / usr / share / info' ' - docdir =的/ usr /共享/ DOC / ImageMagick的' ' - 与模块' ' - 与-GS-字体-DIR =的/ usr /共享/字体/ TYPE1 / gsfonts' ' - 与-magick加加上' ' - 与-的djvu' ' - 与-WMF' ' - 无需-GVC' ' - 使能共享' ' - 无需-DPS' ' - 无需-FPX' ' - 与-perl的' ' - 与-perl的选项= = installdirs来供应商' ' - X-包括=的/ usr /包括/ X11' ' - X-库= / usr / lib中/ X11' ' - 无需-RSVG' ' - 高速缓存文件= .. / .. / config.cache的' ' - 无需-GCC-拱' ' - 禁用静音规则' ' - 与量子深度= 16' ' build_alias = x86_64的-Linux的GNU' ' CFLAGS = -g -O2 -fstack-protector-strong -Wformat -Werror = format-security' ' LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl, - as-needed' ' CPPFLAGS = -D_FORTIFY_SOURCE = 2' ' CXXFLAGS = -g -O2 -fstack-protector-strong -Wformat -Werror = format-security'

CPPFLAGS       -I/usr/include/ImageMagick-6
CXX            g++
CXXFLAGS       -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread
DEFS           -DHAVE_CONFIG_H
DELEGATES      bzlib djvu mpeg fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pango png ps tiff wmf x xml zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fpx=no --with-gslib=no --with-fontpath= --with-gs-font-dir=/usr/share/fonts/type1/gsfonts --with-gvc=no --with-rsvg=no=
FILTER_PATH    /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/modules-Q16/filters
INCLUDE_PATH   /usr/include/ImageMagick-6
LDFLAGS        -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -L/usr/lib/X11
LIBRARY_PATH   /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9
LIBS           -llcms2 -lfreetype -llqr-1 -lglib-2.0 -lfftw3 -lfontconfig -lfreetype -lXext -lSM -lICE -lX11 -lXt -llzma -lbz2 -lz -lltdl -lm -lgomp
PCFLAGS        -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16

我尝试过以下方法:

  1. wget http://www.imagemagick.org/download/ImageMagick.tar.gz
  2. tar xvfz ImageMagick.tar.gz
  3. cd ImageMagick
  4. ./configure --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes --with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes --with-pdf=yes --disable-shared
  5. 使
  6. sudo make install
  7. sudo ldconfig / usr / local / lib
  8. 再次运行" convert -list configure"并看看变化
  9. 但错误保持不变。

0 个答案:

没有答案