<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Penguin on Rails &#187; Rails</title>
	<atom:link href="http://www.cherpec.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cherpec.com</link>
	<description>linux + ruby on rails = love</description>
	<lastBuildDate>Thu, 17 Jun 2010 14:06:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Howto install RMagick 2 on CentOS/RHEL 5</title>
		<link>http://www.cherpec.com/2009/10/howto-install-rmagick-2-on-centosrhel-5/</link>
		<comments>http://www.cherpec.com/2009/10/howto-install-rmagick-2-on-centosrhel-5/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 17:21:00 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Centos Plus]]></category>
		<category><![CDATA[Dag]]></category>
		<category><![CDATA[epel]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[RMagick]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[RPMForge]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=525</guid>
		<description><![CDATA[Installing RMagick 2 on CentOS/RHEL 5 it&#8217;s not that hard, you just need to install ImageMagick  newer than 6.3.5 (CentOS/RHEL 5 is shipping ImageMagick 6.2.8) and  that&#8217;s the hardest part of the job.

&#91;root@silver ~&#93;# gem install rmagick
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
     [...]]]></description>
			<content:encoded><![CDATA[<p>Installing RMagick 2 on CentOS/RHEL 5 it&#8217;s not that hard, you just need to install ImageMagick  newer than 6.3.5 (CentOS/RHEL 5 is shipping ImageMagick 6.2.8) and  that&#8217;s the hardest part of the job.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># gem install rmagick</span>
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby extconf.rb
checking <span style="color: #000000; font-weight: bold;">for</span> Ruby version <span style="color: #000000; font-weight: bold;">&gt;</span>= 1.8.5... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> gcc... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> Magick-config... <span style="color: #c20cb9; font-weight: bold;">yes</span>
checking <span style="color: #000000; font-weight: bold;">for</span> ImageMagick version <span style="color: #000000; font-weight: bold;">&gt;</span>= 6.3.5... no
Can<span style="color: #ff0000;">'t install RMagick 2.12.2. You must have ImageMagick 6.3.5 or later.</span></pre></div></div>

<p>I&#8217;ve tried to avoid ImageMagick upgrade and to <a href="http://www.cherpec.com/2008/08/howto-install-rmagick-on-centos-4/">install RMagick 1</a>, but RMagick 1 failed to install with a strange compile error, probably because the gcc compliler shipped with CentOS/RHEL 5 is too new for version 1. </p>
<p>I didn&#8217;t wanted to patch RMagick 1, neither to install from sources (I do prefer RPM packages). So, I&#8217;ve decided to upgrade ImageMagick library to satisfy RMagick 2 requirements.</p>
<p>Subscribe your system to the following repositories:</p>
<ul>
<li><a href="http://wiki.centos.org/AdditionalResources/Repositories/RPMForge#head-20e1f65f19ccf2f5fbf5adb30dbaf5ea963a64ae">RPMforge</a></li>
<li><a href="http://wiki.centos.org/AdditionalResources/Repositories/CentOSPlus#head-ef9d75ccc01fef919e07b65d8e390d3c91e5e993">Centos Plus</a></li>
<li><a href="http://fedoraproject.org/wiki/EPEL/FAQ#howtouse">EPEL</a></li>
</ul>
<p>Install the following packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># yum --enablerepo=epel --enablerepo=rpmforge --enablerepo=centosplus install djvulibre-devel libwmf-devel jasper-devel libtool-ltdl-devel librsvg2-devel openexr-devel graphviz-devel gcc gcc-c++ ghostscript freetype-devel libjpeg-devel libpng-devel giflib-devel libwmf-devel libexif-devel libtiff-devel</span></pre></div></div>

<p>Add &#8220;&#8211;noplugins&#8221; if you are using &#8220;yum-priorities&#8221;, or it will fail to install packages.</p>
<p>Download <a href='http://www.cherpec.com/wp-content/uploads/2009/10/ImageMagick.spec'>ImageMagick.spec</a> to your SPECS directory and <a href="ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.5.7-0.tar.bz2">ImageMagick-6.5.7-0.tar.bz2</a> to SOURCES directory and then rebuild the rpm using rpmbuild:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver SPECS<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpmbuild -ba ImageMagick.spec</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Or just grab the source RPM from here:<br />
<a href="http://red.penguin.ro/SRPMS/ImageMagick-6.5.7-0.src.rpm">http://red.penguin.ro/SRPMS/ImageMagick-6.5.7-0.src.rpm</a></p>
<p>and build it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpmbuild --rebuild ImageMagick-6.5.7-0.src.rpm </span>
Installing ImageMagick-6.5.7-0.src.rpm
warning: user vitalie does not exist - using root
warning: group vitalie does not exist - using root
warning: user vitalie does not exist - using root
warning: group vitalie does not exist - using root
Executing<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">%</span>prep<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>rpm-tmp.11936
+ <span style="color: #7a0874; font-weight: bold;">umask</span> 022
+ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>BUILD
+ <span style="color: #007800;">LANG</span>=C
+ <span style="color: #7a0874; font-weight: bold;">export</span> LANG
+ <span style="color: #7a0874; font-weight: bold;">unset</span> DISPLAY
+ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>BUILD
+ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> ImageMagick-6.5.7-<span style="color: #000000;">0</span>
+ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #660033;">-dc</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>SOURCES<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-6.5.7-0.tar.bz2
+ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xf</span> -
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
Requires<span style="color: #7a0874; font-weight: bold;">&#40;</span>rpmlib<span style="color: #7a0874; font-weight: bold;">&#41;</span>: rpmlib<span style="color: #7a0874; font-weight: bold;">&#40;</span>CompressedFileNames<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>= 3.0.4-<span style="color: #000000;">1</span> rpmlib<span style="color: #7a0874; font-weight: bold;">&#40;</span>PayloadFilesHavePrefix<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">4.0</span>-<span style="color: #000000;">1</span>
Requires: <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> ImageMagick-c++ = 6.5.7-<span style="color: #000000;">0</span> ImageMagick-devel = 6.5.7-<span style="color: #000000;">0</span> libMagick++.so.2<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Processing files: ImageMagick-debuginfo-6.5.7-<span style="color: #000000;">0</span>
Provides: Magick.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> analyze.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> art.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> avi.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> avs.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> bmp.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> braille.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> cals.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> caption.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> cin.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> cip.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> clip.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> cmyk.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> cut.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dcm.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dds.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dib.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> djvu.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dng.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dot.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> dpx.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ept.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> fax.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> fits.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> gif.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> gradient.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> gray.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> hald.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> histogram.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> hrz.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> html.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> icon.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> info.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> inline.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ipl.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> jp2.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> jpeg.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> label.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> libMagick++.so.2.0.0.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> libMagickCore.so.2.0.0.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> libMagickWand.so.2.0.0.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> magick.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> map.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mat.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> matte.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> meta.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> miff.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mono.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mpc.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mpeg.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mpr.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> msl.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mtv.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> mvg.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> null.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> otb.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> palm.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pattern.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pcd.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pcl.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pcx.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pdb.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pdf.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pict.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pix.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> plasma.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> png.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pnm.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> preview.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ps.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ps2.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ps3.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> psd.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> pwp.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> raw.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> rgb.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> rla.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> rle.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> scr.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> sct.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> sfw.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> sgi.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> stegano.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> sun.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> svg.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> tga.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> thumbnail.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> tiff.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> tile.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> tim.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ttf.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> txt.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> uil.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> url.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> uyvy.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> vicar.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> vid.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> viff.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> wbmp.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> wmf.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> wpg.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> x.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xbm.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xc.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xcf.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xpm.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xps.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> xwd.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> ycbcr.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span> yuv.so.debug<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>64bit<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Requires<span style="color: #7a0874; font-weight: bold;">&#40;</span>rpmlib<span style="color: #7a0874; font-weight: bold;">&#41;</span>: rpmlib<span style="color: #7a0874; font-weight: bold;">&#40;</span>CompressedFileNames<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>= 3.0.4-<span style="color: #000000;">1</span> rpmlib<span style="color: #7a0874; font-weight: bold;">&#40;</span>PayloadFilesHavePrefix<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>= <span style="color: #000000;">4.0</span>-<span style="color: #000000;">1</span>
Checking <span style="color: #000000; font-weight: bold;">for</span> unpackaged <span style="color: #c20cb9; font-weight: bold;">file</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>rpm<span style="color: #000000; font-weight: bold;">/</span>check-files <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-6.5.7-<span style="color: #000000;">0</span>-root-root
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-devel-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-doc-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-perl-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-c++-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-c++-devel-6.5.7-0.x86_64.rpm
Wrote: <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>RPMS<span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-debuginfo-6.5.7-0.x86_64.rpm
Executing<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">%</span>clean<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>rpm-tmp.25482
+ <span style="color: #7a0874; font-weight: bold;">umask</span> 022
+ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>BUILD
+ <span style="color: #7a0874; font-weight: bold;">cd</span> ImageMagick-6.5.7-<span style="color: #000000;">0</span>
+ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ImageMagick-6.5.7-<span style="color: #000000;">0</span>-root-root
+ <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
Executing<span style="color: #7a0874; font-weight: bold;">&#40;</span>--clean<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>rpm-tmp.25482
+ <span style="color: #7a0874; font-weight: bold;">umask</span> 022
+ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>worf<span style="color: #000000; font-weight: bold;">/</span>rpmbuild<span style="color: #000000; font-weight: bold;">/</span>BUILD
+ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> ImageMagick-6.5.7-<span style="color: #000000;">0</span>
+ <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></div></div>

<p>Uninstall i386 ImageMagick libraries if you are on x86_64 system:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -qa | grep ImageMagick | grep -i i386 | xargs rpm -e</span></pre></div></div>

<p>Install the new RPMs compiled in the  previous steps:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver x86_64<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># rpm -Uvh ImageMagick-6.5.7-0.x86_64.rpm ImageMagick-c++-6.5.7-0.x86_64.rpm ImageMagick-c++-devel-6.5.7-0.x86_64.rpm ImageMagick-devel-6.5.7-0.x86_64.rpm</span></pre></div></div>

<p>Finally, install the RMagick 2 plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># gem install rmagick --no-rdoc --no-ri</span>
Building native extensions.  This could take a while...
Successfully installed rmagick-2.12.2
<span style="color: #000000;">1</span> gem installed</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/10/howto-install-rmagick-2-on-centosrhel-5/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>acts_as_redis_counter plugin</title>
		<link>http://www.cherpec.com/2009/10/acts_as_redis_counter-plugin/</link>
		<comments>http://www.cherpec.com/2009/10/acts_as_redis_counter-plugin/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 11:36:52 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[ActsAsRedisCounter]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[counter]]></category>
		<category><![CDATA[countes]]></category>
		<category><![CDATA[high performance]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[redis]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=500</guid>
		<description><![CDATA[I&#8217;ve just released acts_as_redis_counter plugin for Rails.
Description:
The acts_as_redis_counter plugin implements high performance counters using write-back strategy with Redis key-value database.
Enjoy it!
http://github.com/vitalie/acts_as_redis_counter
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released <strong>acts_as_redis_counter</strong> plugin for Rails.</p>
<p>Description:</p>
<p>The acts_as_redis_counter plugin implements high performance counters using write-back strategy with Redis key-value database.</p>
<p>Enjoy it!<br />
<a href="http://github.com/vitalie/acts_as_redis_counter">http://github.com/vitalie/acts_as_redis_counter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/10/acts_as_redis_counter-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Rails virtual hosts with mod_macro</title>
		<link>http://www.cherpec.com/2009/10/easy-rails-virtual-hosts-with-mod_macro/</link>
		<comments>http://www.cherpec.com/2009/10/easy-rails-virtual-hosts-with-mod_macro/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:43:16 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apxs]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[mod_macro]]></category>
		<category><![CDATA[mod_passenger]]></category>
		<category><![CDATA[mod_rails]]></category>
		<category><![CDATA[passenger]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=465</guid>
		<description><![CDATA[Keeping a separate file for each virtual host in /etc/httpd/vhosts.d it&#8217;s clean and cool, but when you have many virtual hosts with same settings it&#8217;s a pain to keep them updated. We need a template system for Apache configurations and mod_macro module it&#8217;s a handy tool for this job.
Download module version suited for your Apache [...]]]></description>
			<content:encoded><![CDATA[<p>Keeping a separate file for each virtual host in /etc/httpd/vhosts.d it&#8217;s clean and cool, but when you have many virtual hosts with same settings it&#8217;s a pain to keep them updated. We need a template system for Apache configurations and <a href="http://www.cri.ensmp.fr/~coelho/mod_macro/">mod_macro</a> module it&#8217;s a handy tool for this job.</p>
<p>Download module version suited for your Apache from:<br />
<a href="http://www.cri.ensmp.fr/~coelho/mod_macro/">http://www.cri.ensmp.fr/~coelho/mod_macro/</a></p>
<p>Ensure that you have httpd-devel package installed then untar archive and compile mod_macro module with apxs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver tmp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># wget http://www.cri.ensmp.fr/~coelho/mod_macro/mod_macro-1.1.10.tar.bz2</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver tmp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># tar xvfjp mod_macro-1.1.10.tar.bz2 </span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver tmp<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd mod_macro-1.1.10</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>silver mod_macro-1.1.10<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># apxs -cia mod_macro.c </span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>libtool <span style="color: #660033;">--silent</span> <span style="color: #660033;">--mode</span>=compile <span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-prefer-pic</span> <span style="color: #660033;">-O2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-pipe</span> <span style="color: #660033;">-Wall</span> -Wp,-D_FORTIFY_SOURCE=<span style="color: #000000;">2</span> <span style="color: #660033;">-fexceptions</span> <span style="color: #660033;">-fstack-protector</span> <span style="color: #660033;">--param</span>=ssp-buffer-size=<span style="color: #000000;">4</span> <span style="color: #660033;">-m64</span> <span style="color: #660033;">-mtune</span>=generic <span style="color: #660033;">-fno-strict-aliasing</span>  <span style="color: #660033;">-DLINUX</span>=<span style="color: #000000;">2</span> -D_REENTRANT -D_GNU_SOURCE <span style="color: #660033;">-pthread</span> -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>httpd  -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span>   -I<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span>   <span style="color: #660033;">-c</span> <span style="color: #660033;">-o</span> mod_macro.lo mod_macro.c <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> mod_macro.slo
mod_macro.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'looks_like_an_argument'</span>:
mod_macro.c:<span style="color: #000000;">316</span>: warning: cast from pointer to integer of different <span style="color: #c20cb9; font-weight: bold;">size</span>
mod_macro.c: In <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #ff0000;">'say_it'</span>:
mod_macro.c:<span style="color: #000000;">929</span>: warning: cast from pointer to integer of different <span style="color: #c20cb9; font-weight: bold;">size</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>libtool <span style="color: #660033;">--silent</span> <span style="color: #660033;">--mode</span>=<span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-o</span> mod_macro.la  <span style="color: #660033;">-rpath</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules <span style="color: #660033;">-module</span> <span style="color: #660033;">-avoid-version</span>    mod_macro.lo
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>instdso.sh <span style="color: #007800;">SH_LIBTOOL</span>=<span style="color: #ff0000;">'/usr/lib64/apr-1/build/libtool'</span> mod_macro.la <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>apr-<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>libtool <span style="color: #660033;">--mode</span>=<span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> mod_macro.la <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> .libs<span style="color: #000000; font-weight: bold;">/</span>mod_macro.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>mod_macro.so
<span style="color: #c20cb9; font-weight: bold;">cp</span> .libs<span style="color: #000000; font-weight: bold;">/</span>mod_macro.lai <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>mod_macro.la
<span style="color: #c20cb9; font-weight: bold;">cp</span> .libs<span style="color: #000000; font-weight: bold;">/</span>mod_macro.a <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>mod_macro.a
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>mod_macro.a
ranlib <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>mod_macro.a
<span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PATH</span>:/sbin&quot;</span> ldconfig <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules
<span style="color: #660033;">----------------------------------------------------------------------</span>
Libraries have been installed <span style="color: #000000; font-weight: bold;">in</span>:
   <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib64<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>modules
&nbsp;
If you ever happen to want to <span style="color: #c20cb9; font-weight: bold;">link</span> against installed libraries
<span style="color: #000000; font-weight: bold;">in</span> a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the <span style="color: #000000; font-weight: bold;">`</span>-LLIBDIR<span style="color: #ff0000;">'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH'</span> environment variable
     during execution
   - add LIBDIR to the <span style="color: #000000; font-weight: bold;">`</span>LD_RUN_PATH<span style="color: #ff0000;">' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR'</span> linker flag
   - have your system administrator add LIBDIR to <span style="color: #000000; font-weight: bold;">`/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ld.so.conf<span style="color: #ff0000;">'
&nbsp;
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/lib64/httpd/modules/mod_macro.so
[activating module `macro'</span> <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Create a file that will keep your macros in Apache&#8217;s conf.d directory (example: _mod_macro.conf), conf.d files are executed after modules are loaded:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/httpd/conf.d/_mod_macro.conf</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># RailsHost macro</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Macro RailsHost <span style="color: #007800;">$host</span> <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    ServerName www.<span style="color: #007800;">$host</span>
    ServerAlias <span style="color: #007800;">$host</span>
    DocumentRoot <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>current<span style="color: #000000; font-weight: bold;">/</span>public
&nbsp;
    CustomLog <span style="color: #ff0000;">&quot;logs/<span style="color: #007800;">$host_access</span>.log&quot;</span> combined
    ErrorLog <span style="color: #ff0000;">&quot;logs/<span style="color: #007800;">$host_error</span>.log&quot;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Passenger settings</span>
    RailsBaseURI <span style="color: #000000; font-weight: bold;">/</span>
    RailsMaxPoolSize <span style="color: #000000;">1</span>
    RailsPoolIdleTime <span style="color: #000000;">3600</span>
    RailsEnv production
&nbsp;
    <span style="color: #666666; font-style: italic;"># Redirect example.com -&gt; www.example.com</span>
    RewriteEngine On
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^www.<span style="color: #007800;">$host</span>
    RewriteRule ^<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.<span style="color: #007800;">$host</span><span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Check for maintenance file and redirect all requests</span>
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>DOCUMENT_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>maintenance.html <span style="color: #660033;">-f</span>
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SCRIPT_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>maintenance.html
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SCRIPT_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^<span style="color: #000000; font-weight: bold;">/</span>images
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SCRIPT_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^<span style="color: #000000; font-weight: bold;">/</span>stylesheets
    RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SCRIPT_FILENAME<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^<span style="color: #000000; font-weight: bold;">/</span>javascripts
    RewriteRule ^.<span style="color: #000000; font-weight: bold;">*</span>$ <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>maintenance.html <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
    ErrorDocument <span style="color: #000000;">404</span> <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>current<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>404.html
    ErrorDocument <span style="color: #000000;">422</span> <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>current<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>422.html
    ErrorDocument <span style="color: #000000;">500</span> <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>current<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>500.html
&nbsp;
    Use ModDeflate
    Use ModExpires
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #007800;">$dir</span><span style="color: #000000; font-weight: bold;">/</span>current<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">&gt;</span>
      Options FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
    <span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>Macro<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ModDeflate macro</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Macro ModDeflate<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_deflate.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    AddOutputFilterByType DEFLATE text<span style="color: #000000; font-weight: bold;">/</span>plain
    AddOutputFilterByType DEFLATE text<span style="color: #000000; font-weight: bold;">/</span>html
    AddOutputFilterByType DEFLATE text<span style="color: #000000; font-weight: bold;">/</span>xml
    AddOutputFilterByType DEFLATE text<span style="color: #000000; font-weight: bold;">/</span>css
    AddOutputFilterByType DEFLATE application<span style="color: #000000; font-weight: bold;">/</span>xml
    AddOutputFilterByType DEFLATE application<span style="color: #000000; font-weight: bold;">/</span>xhtml+xml
    AddOutputFilterByType DEFLATE application<span style="color: #000000; font-weight: bold;">/</span>rss+xml
    AddOutputFilterByType DEFLATE application<span style="color: #000000; font-weight: bold;">/</span>javascript
    AddOutputFilterByType DEFLATE application<span style="color: #000000; font-weight: bold;">/</span>x-javascript
&nbsp;
    BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span> gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
    BrowserMatch ^Mozilla<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">4</span>\.0<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">678</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> no-gzip
    BrowserMatch \bMSIE <span style="color: #000000; font-weight: bold;">!</span>no-gzip <span style="color: #000000; font-weight: bold;">!</span>gzip-only-text<span style="color: #000000; font-weight: bold;">/</span>html
  <span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>Macro<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ModExpires macro</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>Macro ModExpires<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_expires.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    ExpiresActive On
    <span style="color: #000000; font-weight: bold;">&lt;</span>LocationMatch <span style="color: #ff0000;">&quot;^/(images|javascripts|stylesheets)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
      ExpiresDefault <span style="color: #ff0000;">&quot;access plus 1 year&quot;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>LocationMatch<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>Macro<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Append RailsHost macro calls to your httpd.conf to define your virtual hosts :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># /etc/httpd/conf/httpd.conf</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>...<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
Use RailsHost vhost1.com <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>virtualhosts<span style="color: #000000; font-weight: bold;">/</span>vhost1.com
Use RailsHost vhost2.com <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>virtualhosts<span style="color: #000000; font-weight: bold;">/</span>vhost2.com</pre></div></div>

<p>Now, your Apache configuration looks much better and when it comes make changes to your configurations you&#8217;ll need to change just one macro.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/10/easy-rails-virtual-hosts-with-mod_macro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PageActions Plugin released</title>
		<link>http://www.cherpec.com/2009/09/pageactions-plugin-released/</link>
		<comments>http://www.cherpec.com/2009/09/pageactions-plugin-released/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 16:23:14 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[PageActions]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=399</guid>
		<description><![CDATA[I&#8217;ve just released PageActions plugin on GitHub. It&#8217;s a really simple Rails plugin, but it helps you to easy define and render actions links in your views. You can view installation and usage instructions on GitHub:

http://github.com/vitalie/page_actions
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released <a href="http://github.com/vitalie/page_actions">PageActions</a> plugin on <a href="http://github.com">GitHub</a>. It&#8217;s a really simple <a href="http://rubyonrails.org/">Rails</a> plugin, but it helps you to easy define and render actions links in your views. You can view installation and usage instructions on GitHub:</p>
<p><a href="http://github.com/vitalie/page_actions"><br />
http://github.com/vitalie/page_actions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/09/pageactions-plugin-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iteration over large data sets in Rails</title>
		<link>http://www.cherpec.com/2009/07/iteration-over-large-data-sets-in-rails/</link>
		<comments>http://www.cherpec.com/2009/07/iteration-over-large-data-sets-in-rails/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 12:07:42 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[data set]]></category>
		<category><![CDATA[iteration]]></category>
		<category><![CDATA[large]]></category>
		<category><![CDATA[migrations]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=348</guid>
		<description><![CDATA[We often need to iterate over the database rows in our migrations. When dealing with millions of records, basic iteration techniques doesn&#8217;t work well because each loaded object is consuming system memory and it issues at least one database query per object to load.

# &#62;&#62; Book.count :all
# =&#62; 4000216

Solution 1

class BooksUpdateTitles &#60; ActiveRecord::Migration
  def [...]]]></description>
			<content:encoded><![CDATA[<p>We often need to iterate over the database rows in our migrations. When dealing with millions of records, basic iteration techniques doesn&#8217;t work well because each loaded object is consuming system memory and it issues at least one database query per object to load.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># &gt;&gt; Book.count :all</span>
<span style="color:#008000; font-style:italic;"># =&gt; 4000216</span></pre></div></div>

<p><strong>Solution 1</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> BooksUpdateTitles <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Migration</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">up</span>
    Books.<span style="color:#9900CC;">all</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>book<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#008000; font-style:italic;"># ...</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">down</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The problem with this version is that it will load all 4000216 objects into memory, all memory will be consumed and it will start to use disk swap and it will take hours to complete. </p>
<p>We can optimize it a little bit by specifying <strong>select</strong> parameter in our query:</p>
<p><strong>Solution 2</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Books.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span>, <span style="color:#ff3333; font-weight:bold;">:select</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'id'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>t<span style="color:#006600; font-weight:bold;">|</span>
  book = Book.<span style="color:#9900CC;">find</span> t.<span style="color:#9900CC;">id</span>
  <span style="color:#008000; font-style:italic;"># ...</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Version 2 still loads all objects in memory but selects only <strong>id</strong> field.</p>
<p>We need to avoid loading all objects in the memory, we&#8217;ll iterate over collection and we&#8217;ll load only current object.</p>
<p><strong>Solution 3</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">last_id = <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">while</span> book = Books.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:first</span>, <span style="color:#ff3333; font-weight:bold;">:conditions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'id &gt; ?'</span>, last_id<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#008000; font-style:italic;"># ...</span>
  last_id = book.<span style="color:#9900CC;">id</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Version 3 it&#8217;s OK, but it can be speed up by loading objects in batch  not just one by one.</p>
<p><strong>Solution 4</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">last_id = <span style="color:#006666;">0</span>
<span style="color:#9966CC; font-weight:bold;">while</span> books = Book.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:all</span>, <span style="color:#ff3333; font-weight:bold;">:conditions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'id &gt; ?'</span>, last_id<span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#ff3333; font-weight:bold;">:limit</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#008000; font-style:italic;"># ...</span>
  last_id = books.<span style="color:#9900CC;">last</span>.<span style="color:#9900CC;">id</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Examining the log:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #66cc66;">...</span>
Domain <span style="color: #993333; font-weight: bold;">LOAD</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.000176</span><span style="color: #66cc66;">&#41;</span>  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`books`</span> <span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #66cc66;">&#40;</span>id <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">100</span>
<span style="color: #66cc66;">...</span></pre></div></div>

<p>We have loaded 100 objects with one query. Solution 4 seems to be the best solution to iterate over large data sets as it uses less memory with fewer SQL requests.</p>
<p><strong>Update:</strong></p>
<p><a href="http://mitchellhashimoto.com/">Mitchell</a> proposed a better solution to use ActiveRecord&#8217;s <strong>find_in_batches</strong> method. DHH commited this feature on February 23, 2009 that permits iterating over large data sets in batches:</p>
<p>Read more:<br />
<a href="http://webonrails.com/2009/02/23/edge-rails-activerecordbaseeach-and-activerecordbasefind_in_batches-for-batch-processing/">WebOnRails</a><br />
<a href="http://github.com/rails/rails/blob/45787bdd0e9ec20b111e570a20b5f66a949b400c/activerecord/lib/active_record/batches.rb">GitHub</a></p>
<p><strong>Solution 5</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">Book.<span style="color:#9900CC;">find_in_batches</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:batch_size</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">100</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>results<span style="color:#006600; font-weight:bold;">|</span>
<span style="color:#008000; font-style:italic;"># Do something with results</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/07/iteration-over-large-data-sets-in-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Missing host to link to! Please provide :host parameter or set default_url_options[:host]</title>
		<link>http://www.cherpec.com/2009/06/missing-host-to-link-to-please-provide-host-parameter-or-set-default_url_optionshost/</link>
		<comments>http://www.cherpec.com/2009/06/missing-host-to-link-to-please-provide-host-parameter-or-set-default_url_optionshost/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 15:23:16 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ActionMailer]]></category>
		<category><![CDATA[ARMailer]]></category>
		<category><![CDATA[ar_sendmail]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=323</guid>
		<description><![CDATA[Problem:
Missing host to link to! Please provide :host parameter or set default_url_options[:host] when sending emails.
Solution:
You can pass host parameter to url functions, but it&#8217;s cleaner to configure it with a before_filter globally in your application_controller.rb:

  # application_controller.rb
  before_filter :mailer_set_url_options
&#160;
  ...
&#160;
  def mailer_set_url_options
    ActionMailer::Base.default_url_options&#91;:host&#93; = request.host_with_port
  end

]]></description>
			<content:encoded><![CDATA[<p>Problem:<br />
<em>Missing host to link to! Please provide :host parameter or set default_url_options[:host]</em> when sending emails.</p>
<p>Solution:<br />
You can pass <strong>host</strong> parameter to url functions, but it&#8217;s cleaner to configure it with a before_filter globally in your application_controller.rb:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#008000; font-style:italic;"># application_controller.rb</span>
  before_filter <span style="color:#ff3333; font-weight:bold;">:mailer_set_url_options</span>
&nbsp;
  ...
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> mailer_set_url_options
    <span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">default_url_options</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:host</span><span style="color:#006600; font-weight:bold;">&#93;</span> = request.<span style="color:#9900CC;">host_with_port</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/06/missing-host-to-link-to-please-provide-host-parameter-or-set-default_url_optionshost/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple script to convert ERB files to Haml</title>
		<link>http://www.cherpec.com/2009/05/simple-script-to-convert-erb-files-to-haml/</link>
		<comments>http://www.cherpec.com/2009/05/simple-script-to-convert-erb-files-to-haml/#comments</comments>
		<pubDate>Fri, 29 May 2009 16:13:46 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[erb]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=318</guid>
		<description><![CDATA[A simple script to convert .erb files from current directory to .haml :

#!/usr/bin/ruby
&#160;
Dir.glob&#40;&#34;*.html.erb&#34;&#41;.each do &#124;erbname&#124;
  hamlname = erbname.gsub&#40;&#34;.html.erb&#34;, &#34;.html.haml&#34;&#41;
  system &#34;/usr/bin/html2haml #{erbname} #{hamlname}&#34;
end

]]></description>
			<content:encoded><![CDATA[<p>A simple script to convert .erb files from current directory to .haml :</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
&nbsp;
<span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;*.html.erb&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>erbname<span style="color:#006600; font-weight:bold;">|</span>
  hamlname = erbname.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;.html.erb&quot;</span>, <span style="color:#996600;">&quot;.html.haml&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC0066; font-weight:bold;">system</span> <span style="color:#996600;">&quot;/usr/bin/html2haml #{erbname} #{hamlname}&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/05/simple-script-to-convert-erb-files-to-haml/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>File uploads in import scripts</title>
		<link>http://www.cherpec.com/2009/05/file-uploads-in-import-scripts/</link>
		<comments>http://www.cherpec.com/2009/05/file-uploads-in-import-scripts/#comments</comments>
		<pubDate>Thu, 21 May 2009 16:21:32 +0000</pubDate>
		<dc:creator>Vitalie Cherpec</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[attachment_fu]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[fake]]></category>
		<category><![CDATA[fixture_file_upload]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[radiant]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.cherpec.com/?p=296</guid>
		<description><![CDATA[Simulating file uploads in your scripts or from console can be done really simple using Rail&#8217;s ActionController::TestUploadedFile  from action_pack.
Example code:

require 'action_controller/test_process'
&#160;
class ImportExternalData
 ...
  def import_data
    ...
    page.attachments &#60;&#60; PageAttachment.new&#40;
      :uploaded_data =&#62; fake_file_upload&#40;filename, mime_type&#41;,
      :title =&#62; title,
  [...]]]></description>
			<content:encoded><![CDATA[<p>Simulating file uploads in your scripts or from console can be done really simple using <a href="http://rubyonrails.org/">Rail</a>&#8217;s <a href="http://api.rubyonrails.org/classes/ActionController/TestProcess.html">ActionController::TestUploadedFile</a>  from <strong>action_pack</strong>.</p>
<p>Example code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'action_controller/test_process'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> ImportExternalData
 ...
  <span style="color:#9966CC; font-weight:bold;">def</span> import_data
    ...
    <span style="color:#9900CC;">page</span>.<span style="color:#9900CC;">attachments</span> <span style="color:#006600; font-weight:bold;">&lt;&lt;</span> PageAttachment.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>
      <span style="color:#ff3333; font-weight:bold;">:uploaded_data</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> fake_file_upload<span style="color:#006600; font-weight:bold;">&#40;</span>filename, mime_type<span style="color:#006600; font-weight:bold;">&#41;</span>,
      <span style="color:#ff3333; font-weight:bold;">:title</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> title,
      <span style="color:#ff3333; font-weight:bold;">:description</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> description<span style="color:#006600; font-weight:bold;">&#41;</span>
    ...
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
protected
  <span style="color:#9966CC; font-weight:bold;">def</span> fake_file_upload<span style="color:#006600; font-weight:bold;">&#40;</span>path, mime_type = <span style="color:#0000FF; font-weight:bold;">nil</span>, binary = <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#6666ff; font-weight:bold;">ActionController::TestUploadedFile</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>
      path,
      mime_type,
      binary
    <span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Excerpt from ActionController::TestUploadedFile&#8217;s comments:</p>
<blockquote><p>
Essentially generates a modified Tempfile object similar to the object<br />
you&#8217;d get from the standard library CGI module in a multipart<br />
request. This means you can use an ActionController::TestUploadedFile<br />
object in the params of a test request in order to simulate<br />
a file upload.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.cherpec.com/2009/05/file-uploads-in-import-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
