I've been having issues trying to install ImageMagick-6.8.6-9 w/ ghostscript-9.10.
I've installed ghostscript with the prefix "./configure --prefix=/usr/local/" and tested the "gs" and it returns
"GPL Ghostscript 9.10 (2013-08-30)
Copyright (C) 2013 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 9.10: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting."
When I try to install ImageMagick, I type in the commands:
LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib, /usr/local/share/ghostscript/9.10/lib"
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/share/ghostscript/9.10/lib
./configure --prefix=/usr/local --with-gslib --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ --with-perl-optons=PREFIX=/usr/local/php53
This returns:
ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.
Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu
Option Value
-------------------------------------------------------------------------------
Shared libraries --enable-shared=yes yes
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no
Delegate Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes yes
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes yes
FreeType --with-freetype=yes yes
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (9.10)
Ghostscript fonts --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ /usr/share/fonts/type1/gsfonts//
Ghostscript lib --with-gslib=yes no
Graphviz --with-gvc=no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=yes yes
LCMS v1 --with-lcms=yes yes
LCMS v2 --with-lcms2=yes no
LQR --with-lqr=yes yes
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes no
Magick++ --with-magick-plus-plus=yes yes
MUPDF --with-mupdf=no no
OpenEXR --with-openexr=yes yes
PANGO --with-pango=yes yes
PERL --with-perl=no no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes yes
WEBP --with-webp=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes
X11 Configuration:
X_CFLAGS =
X_PRE_LIBS = -lSM -lICE
X_LIBS =
X_EXTRA_LIBS =
Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.8.6
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -pthread -I/usr/include/OpenEXR -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -I/usr/local/include/ImageMagick-6
PCFLAGS = -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -llqr-1 -lglib-2.0 -lpng12 -ldjvulibre -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -pthread -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lxml2 -lz -lm -lgomp
CXX = g++
CXXFLAGS = -g -O2 -pthread
FEATURES = DPC OpenMP
DELEGATES = bzlib djvu mpeg fontconfig freetype jng jp2 jpeg lcms lqr openexr pango png ps tiff x xml zlib
Then I'll type "make" and "sudo make install."
After the installation, I've gathered some information:
$ convert --version
Version: ImageMagick 6.8.6-9 2013-09-19 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fontconfig freetype jng jp2 jpeg lcms lqr openexr pango pangocairo png png tiff x xml zlib
$ convert -list configure
Path: /usr/local/lib/ImageMagick-6.8.6//config-Q16/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -pthread -I/usr/include/OpenEXR -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CODER_PATH /usr/local/lib/ImageMagick-6.8.6/modules-Q16/coders
CONFIGURE ./configure '--prefix=/usr/local' '--with-gslib' '--with-gs-font-dir=/usr/share/fonts/type1/gsfonts/' '--with-perl-optons=PREFIX=/usr/local/php53'
CONFIGURE_PATH /usr/local/etc/ImageMagick-6/
COPYRIGHT Copyright (C) 1999-2013 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick-6
CXX g++
CXXFLAGS -g -O2 -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib djvu mpeg fontconfig freetype jng jp2 jpeg lcms lqr openexr pango png ps tiff x xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-fontpath= --with-gs-font-dir=/usr/share/fonts/type1/gsfonts/ --with-gvc=no --with-mupdf=no --with-rsvg=no --with-wmf=no --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-6
EXEC-PREFIX /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES DPC OpenMP
FILTER_PATH /usr/local/lib/ImageMagick-6.8.6/modules-Q16/filters
HOST x86_64-unknown-linux-gnu
INCLUDE_PATH /usr/local/include/ImageMagick-6
LDFLAGS -L/usr/local/lib
LIB_VERSION 0x686
LIB_VERSION_NUMBER 6,8,6,9
LIBRARY_PATH /usr/local/lib/ImageMagick-6.8.6
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -llqr-1 -lglib-2.0 -lpng12 -ldjvulibre -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -pthread -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lxml2 -lz -lm -lgomp
NAME ImageMagick
PCFLAGS -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
PREFIX /usr/local
QuantumDepth 16
RELEASE_DATE 2013-09-19
SHARE_PATH /usr/local/share/ImageMagick-6
SHAREARCH_PATH /usr/local/lib/ImageMagick-6.8.6/config-Q16
SVN_REVISION 13089
TARGET_CPU x86_64
TARGET_OS linux-gnu
TARGET_VENDOR unknown
VERSION 6.8.6
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
FEATURES OpenMP
NAME ImageMagick
QuantumDepth 16
$ convert -list delegate
Path: /usr/local/etc/ImageMagick-6/delegates.xml
Delegate Command
-------------------------------------------------------------------------------
blender => "blender" -b "%i" -F PNG -o "%o""\n"convert" -concatenate "%o*.png" "%o"
cdr => "uniconvertor" "%i" "%o.svg"; mv "%o.svg" "%o"
cgm => "ralcgm" -d ps -oC < "%i" > "%o" 2> "%Z"
dng:decode => "ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i"
dot => "dot" -Tsvg "%i" -o "%o"
dvi => "dvips" -q -o "%o" "%i"
eps<=>pdf "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
eps<=>ps "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=nodevice" "-sOutputFile=%o" "-f%i"
fig => "fig2dev" -L ps "%i" "%o"
hpg => "hp2xx" -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o"` "%o"
hpgl => "hp2xx" -q -m eps -f `basename "%o"` "%i"; mv -f `basename "%o"` "%o"
htm => "html2ps" -U -o "%o" "%i"
html => "html2ps" -U -o "%o" "%i"
https => "curl" -s -k -o "%o" "https:%M"
ilbm => "ilbmtoppm" "%i" > "%o"
jxr => "mv "%i" "%i.jxr"; "JxrDecApp" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o"
man => "groff" -man -Tps "%i" > "%o"
miff<= show "display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i"
mpeg:decode => "ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"
pdf<=>eps "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
pdf<=>ps "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=nodevice" "-sOutputFile=%o" "-f%i"
plt => "echo" "set size 1.25,0.62; set terminal postscript portrait color solid; set output \'%o\'; load \'%i\'" > "%u";"gnuplot" "%u"
png<= webp "cwebp" -quiet -q %Q "%i" -o "%o"
pnm<= ilbm "ppmtoilbm" -24if "%i" > "%o"
pnm<= jxr "mv "%i" "%i.pnm"; "" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%o"
pnm<= wdp "mv "%i" "%i.pnm"; "" -i "%i.pnm" -o "%o.jxr"; mv "%i.pnm" "%i"; mv "%o.jxr" "%o"
pov => "povray" "+i%i" -D0 "+o%o" +fn%q +w%w +h%h +a -q9 "-kfi%s" "-kff%n";"convert" -concatenate "%o*.png" "%o"
ps<=>eps "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=epswrite" "-sOutputFile=%o" "-f%i"
ps<=>pdf "gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pdfwrite" "-sOutputFile=%o" "-f%i"
ps<= print "lpr "%i"
rgba<= rle "rawtorle" -o "%o" -v "%i"
scan => "scanimage" -d "%i" > "%o"
scanx => "scanimage" > "%o"
shtml => "html2ps" -U -o "%o" "%i"
sid => "mrsidgeodecode" -if sid -i "%i" -of tif -o "%o" > "%u"
svg => "rsvg-convert" -o "%o" "%i"
tiff<= launch "gimp" "%i"
txt<=>ps "enscript" -o "%o" "%i"
wdp => "mv "%i" "%i.jxr"; "JxrDecApp" -i "%i.jxr" -o "%o.pnm"; mv "%i.jxr" "%i"; mv "%o.pnm" "%o"
webp => "dwebp" -pam "%i" -o "%o"
When I run:
$ convert test.pdf test.jpg
convert: Postscript delegate failed `test.pdf': No such file or directory # error/pdf.c/ReadPDFImage/682.
convert: no images defined `test.jpg' # error/convert.c/ConvertImageCommand/3127.
I've also installed ghostscript first and then ImageMagick. Can't figure out what the problem is because in the ./configure it does pick up that ghostscript version
"Ghostscript None gs (9.10)"
but "Ghostscript lib --with-gslib=yes no"
I also don't notice it in the delegate.xml.
How do I resolve this or update the delegate to have the ghostscript accounted for? I've tried to rebuild/reinstall multiple times.
This is on a linux 64 bit machine hosted on dreamhost
---------------------- UPDATE -------------------------------------------
So the problem is actually with the type of pdf and ghostscript. The underlying issue isn't with ImageMagick but with the ghostscript itself.
It has to deal with a specific pdf file. When i test it with others, it works. I need to find one that doesn't have private information (pdf) so that I can post it.
Below is the error:
Executed this command
$ "gs" -dDEBUG -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=peachjar.jpg"`
START 0 1539248 242651 1301992 20148 true 543 3 <0>
END PROCS 0 1559432 270087 1322176 26044 true 665 3 <0>
gs_std_e.ps 0 1588032 292042 1322176 28524 true 673 3 <0>
gs_il1_e.ps 0 1608216 300680 1322176 28524 true 674 3 <0>
END FONTDIR/ENCS 0 1608216 300908 1322176 28524 true 676 3 <0>
END DEVS 0 1652560 350323 1322176 28524 true 680 3 <0>
END STATD 10 1652560 357399 1322176 31404 true 685 3 <0>
END GS_FONTS 10 1702864 405991 1322176 31404 true 733 3 <0>
END BASIC COLOR 20 1702864 412637 1322176 31404 true 753 3 <0>
END IMAGE 20 1743232 430628 1322176 31404 true 758 3 <0>
gs_btokn.ps 20 1743232 437016 1322176 31404 true 762 3 <0>
gs_dps1.ps 20 1743232 440716 1322176 31404 true 764 3 <0>
gs_dps2.ps 20 1743232 445465 1322176 31404 true 765 3 <0>
gs_type1.ps 20 1763416 453120 1322176 31404 true 773 3 <0>
gs_lev2.ps 20 1792016 488997 1418792 128740 true 779 3 <0>
BEGIN RESOURCES 20 1792016 491563 1418792 128740 true 779 4 <1>
END CATEGORY 20 1792016 494182 1418792 129028 true 780 5 <1>
END GENERIC 20 1801952 511799 1418792 129028 true 782 4 <1>
END FIXED 20 1822136 525178 1418792 129028 true 782 4 <1>
END MISC 20 1842320 536448 1418792 129028 true 782 4 <1>
END ENCODING 20 1842320 539678 1418792 129028 true 782 4 <1>
gs_resmp.ps 30 1862504 560012 1418792 129028 true 786 3 <1>
gs_res.ps 30 1862504 557912 1418792 129028 true 786 3 <0>
gs_typ42.ps 30 1862504 559024 1418792 129028 true 789 3 <0>
gs_cidfn.ps 30 1882688 580725 1418792 129028 true 797 3 <0>
gs_cidcm.ps 30 1902872 603726 1418792 129028 true 797 3 <0>
gs_fntem.ps 30 1971840 659861 1418792 129236 true 799 3 <0>
gs_cidtt.ps 30 1992024 676379 1418792 129236 true 799 3 <0>
gs_cidfm.ps 30 1992024 679831 1418792 129236 true 799 3 <0>
gs_cmap.ps 30 1992024 690035 1418792 129236 true 804 3 <0>
gs_setpd.ps 30 2012208 708143 1418792 129236 true 804 3 <0>
gs_typ32.ps 30 2012208 710172 1418792 129236 true 802 3 <0>
gs_frsd.ps 30 2040808 727746 1418792 129236 true 802 3 <0>
gs_ll3.ps 30 2081176 758534 1418792 129236 true 803 3 <0>
gs_mex_e.ps 30 2081176 761224 1418792 129236 true 803 3 <0>
gs_mro_e.ps 30 2081176 762319 1418792 129236 true 803 3 <0>
gs_pdf_e.ps 40 2081176 763418 1418792 129236 true 803 3 <0>
gs_wan_e.ps 40 2081176 764494 1418792 129236 true 803 3 <0>
pdf_ops.ps 40 2101360 787780 1418792 129236 true 803 3 <0>
gs_l2img.ps 40 2101360 790762 1418792 129236 true 806 3 <0>
pdf_rbld.ps 40 2101360 795591 1418792 129236 true 818 3 <0>
pdf_base.ps 40 2141728 825841 1418792 129236 true 1015 4 <0>
pdf_draw.ps 40 2230880 900681 1418792 129236 true 1015 4 <0>
pdf_font.ps 50 2251064 936749 1418792 129956 true 1016 4 <0>
pdf_main.ps 50 2336928 1014744 1418792 129956 true 1023 4 <0>
pdf_sec.ps 50 2336928 1024953 1418792 129956 true 1023 4 <0>
gs_css_e.ps 50 2357112 1029974 1418792 129956 true 1023 4 <0>
gs_cff.ps 50 2430504 1098514 1418792 129956 true 1025 4 <0>
gs_mgl_e.ps 50 2430504 1100126 1418792 129956 true 1025 4 <0>
gs_agl.ps 50 2869632 1512857 1418792 129956 true 1026 4 <0>
Extend MacRomanEncodingForTrueType for TrueType: insert /product # 184
Extend MacRomanEncodingForTrueType for TrueType: insert /Delta # 198
Extend MacRomanEncodingForTrueType for TrueType: insert /greaterequal # 179
Extend MacRomanEncodingForTrueType for TrueType: insert /lessequal # 178
Extend MacRomanEncodingForTrueType for TrueType: insert /integral # 186
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro # 219 used for /currency
Extend MacRomanEncodingForTrueType for TrueType: insert /infinity # 176
Extend MacRomanEncodingForTrueType for TrueType: insert /notequal # 173
Extend MacRomanEncodingForTrueType for TrueType: insert /summation # 183
Extend MacRomanEncodingForTrueType for TrueType: insert /apple # 240
Extend MacRomanEncodingForTrueType for TrueType: insert /approxequal # 197
Extend MacRomanEncodingForTrueType for TrueType: insert /lozenge # 215
Extend MacRomanEncodingForTrueType for TrueType: insert /radical # 195
Extend MacRomanEncodingForTrueType for TrueType: insert /Omega # 189
Extend MacRomanEncodingForTrueType for TrueType: insert /pi # 185
Extend MacRomanEncodingForTrueType for TrueType: insert /partialdiff # 182
gs_ttf.ps 60 2983888 1641027 1418792 129956 true 1061 4 <0>
gs_icc.ps 60 3004072 1647206 1418792 129956 true 1062 4 <0>
gs_dps.ps 60 3012488 1662879 1418792 130450 true 1075 4 <0>
gs_dpnxt.ps 60 3012488 1664433 1418792 130450 true 1092 4 <0>
gs_epsf.ps 60 3012488 1670674 1418792 130450 true 1104 4 <0>
gs_fapi.ps 60 3012488 1673807 1418792 130450 true 1104 4 <0>
gs_pdfwr.ps 60 3052856 1711072 1418792 134080 true 1136 4 <0>
END INITFILES 60 3073040 1721109 1418792 134080 true 1164 4 <0>
/usr/share/ghostscript/8.71/Resource/Init/Fontmap 60 3073040 1724450 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/8.71/lib/Fontmap 60 3133592 1769567 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/8.71/Resource/Font/Fontmap 60 3133592 1769616 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/fonts/Fontmap 60 3133592 1769652 1418792 135918 true 1165 4 <1>
/var/lib/ghostscript/fonts/Fontmap 60 3133592 1769686 1418792 135918 true 1165 4 <1>
/usr/share/cups/fonts/Fontmap 70 3173960 1797151 1418792 135918 true 1165 4 <1>
/usr/share/ghostscript/fonts/Fontmap 70 3173960 1797187 1418792 135918 true 1165 4 <1>
/usr/local/lib/ghostscript/fonts/Fontmap 70 3173960 1797227 1418792 135918 true 1165 4 <1>
/usr/share/fonts/Fontmap 70 3173960 1797251 1418792 135918 true 1165 4 <1>
END FONTS 70 3173960 1797324 1418792 135918 true 1165 4 <0>
END DEVICE 70 3759296 2383796 1416984 134110 true 1169 4 <0>
END CONFIG 70 3759296 2384062 1416984 134110 true 1169 4 <0>
Checking.
-dict-
-dict-
-mark-
-dict-
true
Merging.
-dict-
-dict-
-mark-
-dict-
true
Selecting.
-dict-
-dict-
-dict-
-mark-
-dict-
true
Constructing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Putting.
[612.0 792.0]
/.MediaSize
0
/%MediaSource
0
/%MediaDestination
true
/.LockSafetyParams
-mark-
true
-dict-
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Result of putting.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Installing.
false
-device-
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
Finishing.
-dict-
-dict-
-dict-
-dict-
-mark-
-dict-
true
END INIT 80 3819848 2443760 10414560 9129632 true 1179 4 <0>
END GLOBAL 90 3819848 2446400 10414560 9130362 false 1176 4 <0>
END GC 100 3870096 1921230 10434744 9133278 false 1161 3 <0>
From what I gather, I first thought it was because I'm missing some fonts that ghostscript depends on to do the conversion.
Extend MacRomanEncodingForTrueType for TrueType: cannot insert /Euro # 219 used for `/currency`
However, I have another server that can convert the pdf, so I figure it has to be some difference in configuration.. So i'm somewhat lost. Any advice why it works on some pdf and doesn't work on some.
Thanks,
D
The Ghostscript error seems to be because you don't have X available, and the display device uses X. As to what the problem is with ImageMagick I'm afraid I'm unable to help. Doesn't look like a Ghostscript problem to me though.
Related
I need to convert uploaded video files with carrierwave. Uploader:
class MediaItemUploader < CarrierWave::Uploader::Base
version :video_for_device, if: :video? do
process :encode_video_for_device
end
storage :file
private
def video? file
if file.path.ends_with?('avi') || ...
true
else
false
end
end
def encode_video_for_device
input_file = file.path
output_file = # How to get the output file path?
system("ffmpeg -i #{input_file} -vcodec libx264 -acodec aac -strict -2 #{output_file}")
end
end
But how do I get the output file path and tell carrierwave to attach this file?
If I hardcode output_file then ffmpeg works fine, but carrierwave puts same file named 'video_for_device_#{original_filename}' along with original file. But I need to process this new file.
Here is a solution:
def encode_video_for_device
tmp_path = File.join File.dirname(current_path), "#{SecureRandom.hex}.mp4"
system("ffmpeg -i #{current_path} -vcodec libx264 -acodec aac -strict -2 #{tmp_path}")
File.rename tmp_path, current_path
end
current_path is a path of the current file which has to be modified before attaching.
You gotta return the processed file in the end of the method, so this should do it:
def encode_video_for_device
input_file = file.path
output_file = "/whatever/temp/filename"
system("ffmpeg -i #{input_file} -vcodec libx264 -acodec aac -strict -2 #{output_file}")
File.new(output_file)
end
I'm using swift to code. I have symbolicated errors but I still can't understand exactly what the error means. I can see these informations
The class name
The function name
Does it contain any other information like
Line number
Type of error (like array out of index..)
or more?
objc_retain # 0xa
-[PFDecoder decodeDictionary:] # 0x3d, PFDecoder.m : 86
-[PFDecoder decodeObject:] # 0x13, PFDecoder.m : 112
#ERROR!
#ERROR!
#ERROR!
_TFV4Cozy11CozyConfigs14checkAnalyticsfMS0_FT_T_ # 0xa2
_TFC4Cozy11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb # 0x18a
_TToFC4Cozy11AppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb # 0x10a
-[NSObject(TLDelegateSW) tlsw_application:didFinishLaunchingWithOptions:] # 0x45
-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] # 0x117
-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] # 0x933
-[UIApplication _runWithMainScene:transitionContext:completion:] # 0x557
__84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke # 0x23
-[UIApplication workspaceDidEndTransaction:] # 0x81
__31-[FBSSerialQueue performAsync:]_block_invoke # 0xb
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ # 0xb
__CFRunLoopDoBlocks # 0xd7
__CFRunLoopRun # 0x2f5
CFRunLoopRunSpecific # 0x1db
CFRunLoopRunInMode # 0x69
-[UIApplication _run] # 0x22d
UIApplicationMain # 0x59f
main # 0x86
start # 0x1
This is another crash log which is shorter.(maybe it'll be easier to explain)
_TFFV4Cozy10CardLoader10initializeFMS0_FT4viewGSqCSo6UIView_14tutorialActiveSb_T_U0_FTGSQPSs9AnyObject__GSQCSo7NSError__T_ # 0x2720
_TFFV4Cozy10CardLoader10initializeFMS0_FT4viewGSqCSo6UIView_14tutorialActiveSb_T_U0_FTGSQPSs9AnyObject__GSQCSo7NSError__T_ # 0xe44
__72-[BFTask(Private) continueWithMainThreadResultBlock:executeIfCancelled:]_block_invoke # 0x50, BFTask+Private.m : 52
__41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 # 0x8, BFTask.m : 287
# 0x13a8
# 0x1368
# 0x597c
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ # 0x8
__CFRunLoopRun # 0x5d0
CFRunLoopRunSpecific # 0x188
# 0xb5a0
UIApplicationMain # 0x5cc
main # 0x70
# 0x2a04
The first one seems like it crashes in the checkAnalytics method of your CozyConfigs class
Rails newbie here, and I'm trying to generate a model using rails generate model. The command I used is exactly rails generate model testmodel name:string, and I got the ridiculously long error below. I'm sorry for the extremely vague question, but I have no idea what to make of this.
I really don't know what to make of it, but I'm assuming it's a problem with the sqlite gem.
Has anyone had this problem before?
Fares:project_name faresalaboud$ rails generate model testmodel name:string
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3/sqlite3_native.bundle: [BUG] Segmentation fault at 0x00000000000418
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
-- Control frame information -----------------------------------------------
c:0017 p:-17588820269308 s:0059 e:000058 TOP [FINISH]
c:0016 p:---- s:0057 e:000056 CFUNC :require
c:0015 p:0020 s:0053 e:000052 BLOCK /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3.rb:6
c:0014 p:0032 s:0050 e:000049 TOP /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3.rb:2 [FINISH]
c:0013 p:---- s:0048 e:000047 CFUNC :require
c:0012 p:0037 s:0044 e:000043 BLOCK /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76 [FINISH]
c:0011 p:---- s:0041 e:000040 CFUNC :each
c:0010 p:0055 s:0038 e:000037 BLOCK /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72 [FINISH]
c:0009 p:---- s:0031 e:000030 CFUNC :each
c:0008 p:0030 s:0028 e:000027 METHOD /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61
c:0007 p:0013 s:0024 e:000023 METHOD /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler.rb:132
c:0006 p:0047 s:0020 e:000019 TOP /Users/faresalaboud/rails_projects/alfaris_guests/config/application.rb:7 [FINISH]
c:0005 p:---- s:0018 e:000017 CFUNC :require
c:0004 p:0289 s:0014 e:000013 TOP /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/commands.rb:43 [FINISH]
c:0003 p:---- s:0008 e:000007 CFUNC :require
c:0002 p:0034 s:0004 E:002478 EVAL bin/rails:4 [FINISH]
c:0001 p:0000 s:0002 E:001198 TOP [FINISH]
bin/rails:4:in `<main>'
bin/rails:4:in `require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/commands.rb:43:in `<top (required)>'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/commands.rb:43:in `require'
/Users/faresalaboud/rails_projects/alfaris_guests/config/application.rb:7:in `<top (required)>'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler.rb:132:in `require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:61:in `each'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `block in require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:72:in `each'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb:76:in `require'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3.rb:2:in `<top (required)>'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:in `rescue in <top (required)>'
/Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/sqlite3-1.3.9/lib/sqlite3.rb:6:in `require'
-- C level backtrace information -------------------------------------------
0 libruby.2.1.0.dylib 0x000000010b99b303 rb_print_backtrace + 29
1 libruby.2.1.0.dylib 0x000000010b99b3ea rb_vm_bugreport + 124
2 libruby.2.1.0.dylib 0x000000010b8a5aa3 report_bug + 285
3 libruby.2.1.0.dylib 0x000000010b8a5981 rb_bug + 179
4 libruby.2.1.0.dylib 0x000000010b93ddbe check_stack_overflow + 0
5 libsystem_platform.dylib 0x00007fff9304c5aa _sigtramp + 26
6 libruby.2.0.0.dylib 0x000000010bfa543a ruby_xmalloc + 26
7 ??? 0x00007ff9bb12dd80 0x0 + 140710562160000
-- Other runtime information -----------------------------------------------
* Loaded script: bin/rails
* Loaded features:
0 enumerator.so
1 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/enc/encdb.bundle
2 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/enc/trans/transdb.bundle
3 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/rbconfig.rb
4 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/compatibility.rb
5 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/defaults.rb
6 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/deprecate.rb
7 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/errors.rb
8 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/version.rb
9 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/requirement.rb
10 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/platform.rb
11 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/basic_specification.rb
12 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/stub_specification.rb
13 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb
14 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/exceptions.rb
15 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb
16 thread.rb
17 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/thread.bundle
18 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/monitor.rb
19 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb
20 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.rb
21 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/pathname.bundle
22 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/pathname.rb
23 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/constants.rb
24 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/user_interaction.rb
25 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/etc.bundle
26 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/config_file.rb
27 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/rubygems_integration.rb
28 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/current_ruby.rb
29 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb
30 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/shared_helpers.rb
31 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/fileutils.rb
32 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/gem_path_manipulation.rb
33 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/gem_helpers.rb
34 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/match_platform.rb
35 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/rubygems_ext.rb
36 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/version.rb
37 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler.rb
38 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/settings.rb
39 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/path_support.rb
40 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/digest.bundle
41 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/digest.rb
42 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/digest/sha1.bundle
43 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/set.rb
44 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/definition.rb
45 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/dependency.rb
46 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/ruby_dsl.rb
47 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/dsl.rb
48 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/source.rb
49 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/common.rb
50 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/generic.rb
51 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/ftp.rb
52 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/http.rb
53 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/https.rb
54 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/ldap.rb
55 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/ldaps.rb
56 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri/mailto.rb
57 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/uri.rb
58 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/socket.bundle
59 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/socket.rb
60 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/timeout.rb
61 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/protocol.rb
62 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/zlib.bundle
63 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/stringio.bundle
64 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/exceptions.rb
65 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/header.rb
66 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/generic_request.rb
67 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/request.rb
68 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/requests.rb
69 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/response.rb
70 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/responses.rb
71 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/proxy_delta.rb
72 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http/backward.rb
73 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/net/http.rb
74 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/date_core.bundle
75 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/date/format.rb
76 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/date.rb
77 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/time.rb
78 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/request.rb
79 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/cgi/core.rb
80 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/cgi/util.rb
81 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/cgi/cookie.rb
82 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/cgi.rb
83 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/uri_formatter.rb
84 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/fcntl.bundle
85 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
86 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/bn.rb
87 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/cipher.rb
88 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/config.rb
89 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/digest.rb
90 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/x509.rb
91 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/buffering.rb
92 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl/ssl.rb
93 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/openssl.rb
94 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/securerandom.rb
95 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/resolv.rb
96 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/remote_fetcher.rb
97 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/text.rb
98 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/name_tuple.rb
99 /usr/local/Cellar/ruby/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/spec_fetcher.rb
100 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/source/rubygems.rb
101 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/strscan.bundle
102 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/source/path.rb
103 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/source/git.rb
104 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/lockfile_parser.rb
105 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/lazy_specification.rb
106 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/tsort.rb
107 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/forwardable.rb
108 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/spec_set.rb
109 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/environment.rb
110 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/runtime.rb
111 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/index.rb
112 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/remote_specification.rb
113 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/endpoint_specification.rb
114 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/dep_proxy.rb
115 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481#global/gems/bundler-1.6.3/lib/bundler/setup.rb
116 /Users/faresalaboud/rails_projects/alfaris_guests/config/boot.rb
117 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe/version.rb
118 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/delegate.rb
119 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe/synchronized_delegator.rb
120 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe.rb
121 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/array/prepend_and_append.rb
122 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/hash/deep_merge.rb
123 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/hash/except.rb
124 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/hash/slice.rb
125 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/i18n-0.6.9/lib/i18n/version.rb
126 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/i18n-0.6.9/lib/i18n/exceptions.rb
127 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/i18n-0.6.9/lib/i18n/interpolate/ruby.rb
128 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/i18n-0.6.9/lib/i18n.rb
129 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/lazy_load_hooks.rb
130 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/i18n-0.6.9/lib/i18n/config.rb
131 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/i18n.rb
132 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe/non_concurrent_cache_backend.rb
133 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe/mri_cache_backend.rb
134 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thread_safe-0.3.4/lib/thread_safe/cache.rb
135 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/inflector/inflections.rb
136 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/inflections.rb
137 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/inflector/methods.rb
138 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/dependencies/autoload.rb
139 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/version.rb
140 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/array/extract_options.rb
141 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/class/attribute_accessors.rb
142 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/concern.rb
143 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/logger_silence.rb
144 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/logger.rb
145 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/logger.rb
146 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support.rb
147 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/object/blank.rb
148 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/kernel/singleton_class.rb
149 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/module/attribute_accessors.rb
150 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/multibyte.rb
151 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/string/multibyte.rb
152 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/inflector/transliterate.rb
153 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/string/inflections.rb
154 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/command.rb
155 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/core_ext/hash_with_indifferent_access.rb
156 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/core_ext/ordered_hash.rb
157 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/error.rb
158 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/invocation.rb
159 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/parser/argument.rb
160 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/parser/arguments.rb
161 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/parser/option.rb
162 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/parser/options.rb
163 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/parser.rb
164 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/shell.rb
165 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/line_editor/basic.rb
166 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/x86_64-darwin13.0/readline.bundle
167 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/line_editor/readline.rb
168 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/line_editor.rb
169 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/util.rb
170 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/base.rb
171 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/group.rb
172 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/open-uri.rb
173 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/generators/actions.rb
174 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/core_ext/io_binary_read.rb
175 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/empty_directory.rb
176 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/create_file.rb
177 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/create_link.rb
178 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/directory.rb
179 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/erb.rb
180 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/file_manipulation.rb
181 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions/inject_into_file.rb
182 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/thor-0.19.1/lib/thor/actions.rb
183 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/generators/base.rb
184 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/generators.rb
185 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/ruby_version_check.rb
186 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/tmpdir.rb
187 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/tempfile.rb
188 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/kernel/reporting.rb
189 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/key_generator.rb
190 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.5/lib/rails/initializable.rb
191 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/singleton.rb
192 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/core_ext/module/delegation.rb
193 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/deprecation/instance_delegator.rb
194 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/notifications/instrumenter.rb
195 /usr/local/Cellar/ruby/2.1.0/lib/ruby/2.1.0/mutex_m.rb
196 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/notifications/fanout.rb
197 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/per_thread_registry.rb
198 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/notifications.rb
199 /Users/faresalaboud/.rvm/gems/ruby-2.0.0-p481/gems/activesupport-4.0.5/lib/active_support/deprecation/behaviors.rb
....
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Abort trap: 6
Searched around and I think you will find luck on this other stack overflow answer. I was about to suggest a more radical move - a complete uninstall of rvm and rails, and reinstalling, but start here first.
If you can't do other rails commands like
rails console
then you will probably have to go this route:
Use this link to nuke your rvm install. And make sure you're following the official rvm install guide here.
UPDATED CONTENT
My Setup is now as follows:
#Carrierwave Initializer
CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => ENV['S3_KEY'],
:aws_secret_access_key => ENV['S3_SECRET'],
}
config.fog_directory = ENV['S3_BUCKET_NAME']
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
end
#Uploader
class ProteinUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
storage :fog
def store_dir
"images/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
end
#Heroku Config Variables
S3_BUCKET_NAME = top5protein
S3_KEY = 'xxx'
S3_SECRET = 'xxx'
#Gemfile
...
gem "fog", "~> 1.14.0"
gem "excon", "~> 0.25.3"
gem 'carrierwave'
gem 'activeadmin'
...
And the error I am still getting is:
Excon::Errors::Forbidden (Expected(200) <=> Actual(403 Forbidden)
2013-07-28T11:51:13.251291+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/excon-0.25.3/lib/excon/connection.rb:260:in `rescue in request'
2013-07-28T11:51:13.251455+00:00 app[web.1]: vendor/bundle/ruby/2.0.0/gems/excon-0.25.3/lib/excon/connection.rb:220:in `request'
2013-07-28T11:51:13.251056+00:00 app[web.1]: FYyKoH99bOV97aK1TQI9dEhIBycFUg2TyP2fYuzY1/Ke+TXevyjKlUA</HostId><SignatureProvided>ZuHHwrD3Qdo9IHNhE14eKiB0OgY=</SignatureProvided><StringToSign>PUT\n\nimage/png\nSun, 28 Jul 2013 11:51:12 +0000\nx-amz-acl:private\n/top5protein/images/general/image/2/Protein1.png</StringToSign><AWSAccessKeyId>AKIAJ5GKDLKK3CPHNTGA</AWSAccessKeyId></Error>", #headers={"x-amz-request-id"=>"04AD4FA1DDE488CE", "x-amz-id-2"=>"SkpxPPpk0FYyKoH99bOV97aK1TQI9dEhIBycFUg2TyP2fYuzY1/Ke+TXevyjKlUA", "Content-Type"=>"application/xml", "Transfer-Encoding"=>"chunked", "Date"=>"Sun, 28 Jul 2013 11:51:12 GMT", "Connection"=>"close", "Server"=>"AmazonS3"}, #status=403, #remote_ip="207.171.163.195">):
and
HNTGA</AWSAccessKeyId></Error>", :headers=>{"x-amz-request-id"=>"04AD4FA1DDE488CE", "x-amz-id-2"=>"SkpxPPpk0FYyKoH99bOV97aK1TQI9dEhIBycFUg2TyP2fYuzY1/Ke+TXevyjKlUA", "Content-Type"=>"application/xml", "Transfer-Encoding"=>"chunked", "Date"=>"Sun, 28 Jul 2013 11:51:12 GMT", "Connection"=>"close", "Server"=>"AmazonS3"}, :status=>403, :remote_ip=>"207.171.163.195"}, #body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><StringToSignBytes>50 55 54 0a 0a 69 6d 61 67 65 2f 70 6e 67 0a 53 75 6e 2c 20 32 38 20 4a 75 6c 20 32 30 31 33 20 31 31 3a 35 31 3a 31 32 20 2b 30 30 30 30 0a 78 2d 61 6d 7a 2d 61 63 6c 3a 70 72 69 76 61 74 65 0a 2f 74 6f 70 35 70 72 6f 74 65 69 6e 2f 69 6d 61 67 65 73 2f 67 65 6e 65 72 61 6c 2f 69 6d 61 67 65 2f 32 2f 50 72 6f 74 65 69 6e 31 2e 70 6e 67</StringToSignBytes><RequestId>04AD4FA1DDE488CE</RequestId><HostId>SkpxPPpk0
If anyone has any further advice that might help then that would be great!
In your case (as noted in the last comment) and in mine, the reason for this error was an incorrect secret key.
I thought I'd leave this here for future people getting this error so they could check the most probable source of the problem first.
I'd like to insert arguement as text onto the image file that user uploads.
With the code below, It doesn't work. It just saves image without any effect.
I'm using the gem called 'papaerclip' for uploading.
comment.rb
#paperclip
has_attached_file :comment_icon,
:styles => {
:thumb=> "100x100>",
:small => "400x400>" },
:convert_options => {
:all => " -stroke '#000C' -strokewidth 2 -annotate 0 'Faerie Dragon' -stroke none -fill white -annotate 0 'Faerie Dragon'" }
How can I insert text to the bottom of images like this example?
How comment.rb should be written?
ImageMagick code
convert dragon.gif -gravity south \
-stroke '#000C' -strokewidth 2 -annotate 0 'Faerie Dragon' \
-stroke none -fill white -annotate 0 'Faerie Dragon' \
anno_outline.jpg
It doesn't like the single quotes you have in your convert_options. Try using:
' -gravity south -stroke "#000C" -strokewidth 2 -annotate 0 "Faerie Dragon" -stroke none -fill white -annotate 0 "Faerie Dragon"'
instead. I am using Paperclip 3.2.0 and was able to get it to apply the text by changing the quotes.
Here is my image attribute:
has_attached_file :avatar,
:styles => {:large => "300x300", :medium => "140x140>", :thumb => "100x100>", :tiny => "50x50" },
:storage => :s3,
:s3_credentials => "#{Rails.root}/config/amazons3.yml",
:path => "avatars/:id/:style_:filename",
:convert_options => {
:all => ' -gravity south -stroke "#000C" -strokewidth 2 -annotate 0 "Faerie Dragon" -stroke none -fill white -annotate 0 "Faerie Dragon"' }