<?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>Official Sanft.com Blog &#187; HowTo</title>
	<atom:link href="http://www.sanft.com/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sanft.com</link>
	<description>Where my opinion counts more!  ;)</description>
	<lastBuildDate>Tue, 28 Jul 2009 14:21:22 +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>Upgrading to Ruby 1.8.6 on Red Hat</title>
		<link>http://www.sanft.com/2008/12/01/upgrading-to-ruby-186-on-red-hat/</link>
		<comments>http://www.sanft.com/2008/12/01/upgrading-to-ruby-186-on-red-hat/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 00:14:40 +0000</pubDate>
		<dc:creator>Ted Sanft</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[originalposts]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.sanft.com/?p=292</guid>
		<description><![CDATA[Excuse me while I get my inner geek on.
I had Red Hat system that needed to be upgrade from running Ruby 1.8.5 to Ruby 1.8.6.  Unfortunately, Red Hat really lags in releasing RPM&#8217;s for many packages, and Ruby is one of the packages.
Now I have drunk the Red Hat RPM Kool-aid.  IMHO using RPM&#8217;s on [...]]]></description>
			<content:encoded><![CDATA[<p>Excuse me while I get my inner geek on.</p>
<p>I had Red Hat system that needed to be upgrade from running Ruby 1.8.5 to Ruby 1.8.6.  Unfortunately, Red Hat really lags in releasing RPM&#8217;s for many packages, and Ruby is one of the packages.</p>
<p>Now I have drunk the Red Hat RPM Kool-aid.  IMHO using RPM&#8217;s on your system is the only sane way to manage a Red Hat based system.  Compiling from source is ugly and hard to manage in the long run.</p>
<p>I called tech support (google.com) and found an RPM based solution to upgrade, but I ran into a few problems that I could find no solution for through &#8220;tech support&#8221;  I am going to walk you through installing ruby 1.8.6 on a Red Hat system using RPM&#8217;s and solving a little issue after you have installed it.<br />
<span id="more-292"></span><br />
First, I decided the best approach for the upgrade was to find a source RPM for ruby 1.8.6.  In my investigations, I also found a couple of large bugs in ruby 1.8.6 below patch level 230, therefore I looked for a Red Hat source RPM for ruby 1.8.6 above patch 230.  Unfortunately, none exist, however Fedora Core 9 is close enough for this process.  Here are the steps I followed to upgrade to 1.8.6 patch level 287:</p>
<p><strong>First, there were some prerequisites:</strong><br />
<code><br />
yum install tk-devel tcl-devel emacs ncurses-devel<br />
</code></p>
<p><strong>Now get the srpm:</strong><br />
<code><br />
cd /tmp<br />
wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/linux/releases/9/Everything/source/SRPMS/ruby-1.8.6.287-2.fc9.src.rpm<br />
</code><br />
<strong>Now that we have it, let&#8217;s install it:</strong><br />
<code><br />
rpm -ivh ruby-1.8.6.287-2.fc9.src.rpm<br />
</code><br />
<strong>Okay, source RPMS is installed, now let&#8217;s build the actual binary RPM&#8217;s:</strong><br />
<code><br />
cd /usr/src/redhat/SPECS/<br />
rpmbuild -bb ruby.spec<br />
</code><br />
<strong>Now the RPM&#8217;s are built, we can install all of the RPM&#8217;s:</strong><br />
<code><br />
cd /usr/src/redhat/RPMS/i386<br />
rpm -Uvh ruby-1.8.6.287-2.i386.rpm \<br />
ruby-debuginfo-1.8.6.287-2.i386.rpm \<br />
ruby-devel-1.8.6.287-2.i386.rpm \<br />
ruby-docs-1.8.6.287-2.i386.rpm<br />
ruby-irb-1.8.6.287-2.i386.rpm \<br />
ruby-libs-1.8.6.287-2.i386.rpm \<br />
ruby-mode-1.8.6.287-2.i386.rpm \<br />
ruby-rdoc-1.8.6.287-2.i386.rpm \<br />
ruby-ri-1.8.6.287-2.i386.rpm \<br />
ruby-tcltk-1.8.6.287-2.i386.rpm<br />
</code><br />
<strong>This should give you ruby 1.8.6 patch level 287:</strong><br />
<code><br />
ruby -v<br />
</code><br />
&#8220;ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-linux]&#8221;</p>
<p><strong>Oh joyful day!  I figured it out!  However, later, I tried to access the console using:</strong><br />
<code><br />
script/console production<br />
</code><br />
<strong>I received:</strong><br />
<code><br />
/usr/lib/ruby/1.8/irb/completion.rb:10:in `require': No such file to load -- readline (LoadError) from    /usr/lib/ruby/1.8/irb/completion.rb:10 from /usr/lib/ruby/1.8/irb/init.rb:218:in `require' from /usr/lib/ruby/1.8/irb/init.rb:218:in `load_modules' from /usr/lib/ruby/1.8/irb/init.rb:216:in `each' from /usr/lib/ruby/1.8/irb/init.rb:216:in `load_modules' from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup' from /usr/lib/ruby/1.8/irb.rb:54:in `start' from /usr/bin/irb:13<br />
</code><br />
<strong>I poked around quite a bit and found this solution:</strong><br />
<code><br />
find / -name readline -print<br />
cd /usr/src/redhat/BUILD/ruby-1.8.6.287/ruby-1.8.6-p287/ext/readline<br />
ruby extconf.rb<br />
make<br />
make install </code> [do this as root/admin]</p>
<p><strong>That should have worked, but it did not. I then turned to tech support (google.com) and found no good answer.  This should work since I did have both readline and readline-devel installed:<br />
</strong> <code><br />
rpm -qa | grep readline<br />
</code><br />
readline-devel-5.1-1.1<br />
readline-5.1-1.1</p>
<p><strong>I did notice that when I ran &#8220;make&#8221; and &#8220;make install&#8221;, it did not do anything.  I then decided to search for readline.h:</strong><br />
<code><br />
find / -name readline.h<br />
</code><br />
<strong>No result?(!)</strong></p>
<p><strong>So, I simply did:</strong><br />
<code><br />
yum remove readline-devel<br />
yum install readline-devel<br />
find / -name readline.h<br />
</code><br />
<strong>This the results were different:</strong><br />
&#8220;/usr/include/readline/readline.h&#8221;<br />
<strong>w00t!</strong></p>
<p><strong>I ran this again:</strong><br />
<code><br />
cd /usr/src/redhat/BUILD/ruby-1.8.6.287/ruby-1.8.6-p287/ext/readline<br />
ruby extconf.rb<br />
make<br />
make install </code></p>
<p><strong>Now everything works!!</strong></p>
<p>I hope you found this useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sanft.com/2008/12/01/upgrading-to-ruby-186-on-red-hat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
