<?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>Tony Baltazar &#187; Ruby</title>
	<atom:link href="http://abaltazar.org/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://abaltazar.org</link>
	<description>Free Software / Ruby / Security / Arsenal Football Club</description>
	<lastBuildDate>Tue, 24 Jan 2012 07:52:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Tweet from the command line</title>
		<link>http://abaltazar.org/2011/12/15/tweet-from-the-command-line/</link>
		<comments>http://abaltazar.org/2011/12/15/tweet-from-the-command-line/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 07:24:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=979</guid>
		<description><![CDATA[Avoid using Twitter&#8217;s new god awful interface and tweet from the command line like a real man.
cmd_twitter.rb
]]></description>
			<content:encoded><![CDATA[<p>Avoid using Twitter&#8217;s new god awful interface and tweet from the command line like a real man.</p>
<p><a href="http://www.abaltazar.org/scripts/cmd_twitter.rb">cmd_twitter.rb</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/12/15/tweet-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rubygems annoyances</title>
		<link>http://abaltazar.org/2011/10/01/rubygems-annoyances/</link>
		<comments>http://abaltazar.org/2011/10/01/rubygems-annoyances/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 07:58:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=871</guid>
		<description><![CDATA[Earlier today while working on Ruby CLI Mailer, I had a problem installing the pony rubygem. I was getting the following error when trying to install the pony via rubygems:

ERROR:  Error installing pony:
        invalid gem format for /home/tony/.rvm/gems/ruby-1.8.7-p352/cache/pony-1.3.gem
ERROR:  Error installing pony:
      [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today while working on <a href="http://www.rubyninja.net/rcli_mailer-01/">Ruby CLI Mailer</a>, I had a problem installing the <a href="http://rubygems.org/gems/pony">pony</a> rubygem. I was getting the following error when trying to install the pony via rubygems:<br />
<code><br />
ERROR:  Error installing pony:<br />
        invalid gem format for /home/tony/.rvm/gems/ruby-1.8.7-p352/cache/pony-1.3.gem<br />
ERROR:  Error installing pony:<br />
        invalid gem format for /home/tony/.rvm/gems/ruby-1.9.2-p290/cache/pony-1.3.gem</p>
<p></code></p>
<p>I soon came to notice that the problem was because the Barnes&#038;Noble wifi session had expired and I had to reconnect to their network. After getting my laptop online, I tried to install the gem, but once again I was still getting the invalid gem error. This was even after I removed the gem from all Ruby installations (RVM) and tried to install them from scratch. Knowing that the issue was caused because the files were partially downloaded, I removed both cache gem files and voila, I was able to install the pony rubygem.</p>
<p>While it would be wonderful if every single rubygem package would be digitally signed of some sort, it would have been helpful if at least it had some sort of checksum verification after it downloads the package prior to installing any gems. This is certainly somewhat scary since rubygems is not able to detect/verify that it downloaded the right package without any sort of alterations.  </p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/10/01/rubygems-annoyances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Git cloned repo &#8211; installing rvm</title>
		<link>http://abaltazar.org/2011/08/01/first-git-cloned-repo-installing-rvm/</link>
		<comments>http://abaltazar.org/2011/08/01/first-git-cloned-repo-installing-rvm/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 06:12:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=806</guid>
		<description><![CDATA[For quite a while now, I&#8217;ve heard good things about the Ruby Version Manager (if only I knew about it before I installed Ruby 1.9 from source and screwed up rubygems). So I decided to install this application, but to my surprise in reading the documentation, the official install is only made via cloning the [...]]]></description>
			<content:encoded><![CDATA[<p>For quite a while now, I&#8217;ve heard good things about the Ruby Version Manager (if only I knew about it before I installed Ruby 1.9 from source and screwed up rubygems). So I decided to install this application, but to my surprise in reading the documentation, the official install is only made via cloning the latest rvm github repository.</p>
<p><code></p>
<p>sudo apt-get install git git-core git-doc git-svn<br />
mkdir Git_Repos/rvm<br />
cd Git_Repos/rvm<br />
git config --global user.name "Alpha01"<br />
git config --global user.email "root@rubyninja.org"<br />
git config --global core.editor /usr/bin/vim<br />
git init<br />
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)<br />
</code><br />
Congratz, I just installed rvm and cloned my very first git repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/08/01/first-git-cloned-repo-installing-rvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What’s in my bookshelf?</title>
		<link>http://abaltazar.org/2011/06/12/what%e2%80%99s-in-my-bookshelf-4/</link>
		<comments>http://abaltazar.org/2011/06/12/what%e2%80%99s-in-my-bookshelf-4/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 20:51:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=676</guid>
		<description><![CDATA[As always I&#8217;m pretty late in writing my book reviews. This time it&#8217;s been well over 6 months since I finished reading the book &#8220;Beginning Ruby&#8221; (first edition) by Peter Cooper. I have to say is this by far the best Ruby book that I&#8217;ve read so far. (This is out of a 13 book [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://abaltazar.org/wordpress/wp-content/uploads/2011/06/beginning-ruby-cover.jpg"><img src="http://abaltazar.org/wordpress/wp-content/uploads/2011/06/beginning-ruby-cover.jpg" alt="" title="beginning-ruby-cover" width="218" height="282" class="alignleft size-full wp-image-678" /></a>As always I&#8217;m pretty late in writing my book reviews. This time it&#8217;s been well over 6 months since I finished reading the book &#8220;Beginning Ruby&#8221; (first edition) by Peter Cooper. I have to say is this by far the best Ruby book that I&#8217;ve read so far. (<a href="http://www.flickr.com/photos/alpha01/5825451207/in/photostream">This is out of a 13 book collection that I own on Ruby programming.</a>) I&#8217;ve always been a fan of Apress &#8220;Beginning&#8221; title&#8217;s, and this book is definitely not the exception. Although this book is technically considered for beginning/intermediate programmers wanting to dive to the wonderful world of Ruby, I feel this book is perfect for all levels of programming expertise. The authors does a wonderful job explain the concepts of each chapter and slowly building you to what will be the next chapter. Like Apress&#8217; &#8220;Beginning Perl&#8221; book help me tremendously in learning the language, I have to say this book taught how to program in Ruby. </p>
<p>I&#8217;ll definitely come back to this book and use as a reference. Anyone new or already experienced using Ruby, will definitely benefit from reading this book. I hope this book (all editions) gets the high praise from the Ruby community, which it deserves, as in my eyes this is a classic programming book and I see this title as the Llama/Camel book for the Ruby World.</p>
<p>Chapter 1: Let&#8217;s Get it Started: Installing Ruby<br />
Chapter 2: Programming == Joy: A Whistle-Stop Tour of Ruby and Object Orientation<br />
Chapter 3: Ruby&#8217;s Building Blocks: Data, Expressions and Flow Control<br />
Chapter 4: Developing a Basic Ruby Application<br />
Chapter 5: The Ruby Ecosystem<br />
Chapter 6: Classes, Objects, and Modules<br />
Chapter 7: Projects and Libraries<br />
Chapter 8: Documentation, Error Handling, Debugging, and Testing<br />
Chapter 9: Files and Databases<br />
Chapter 10: Deploying Ruby Applications and Libraries<br />
Chapter 11: Advance Ruby Features<br />
Chapter 12: Tying it Together: Developing a Larger Ruby Application<br />
Chapter 13: Ruby on Rails: Ruby&#8217;s Killer App<br />
Chapter 14: Ruby and the Internet<br />
Chapter 15: Networking, Sockets, and Daemons<br />
Chapter 16: Useful Ruby Libraries and Gems</p>
<p><a href="http://www.amazon.com/Beginning-Ruby-Professional-Peter-Cooper/dp/1430223634/ref=sr_1_1?ie=UTF8&#038;qid=1307909654&#038;sr=8-1">Beginning Ruby (2nd Edition)</a><br />
5/5</p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/06/12/what%e2%80%99s-in-my-bookshelf-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving to Ruby 1.9</title>
		<link>http://abaltazar.org/2011/04/14/moving-to-ruby-1-9/</link>
		<comments>http://abaltazar.org/2011/04/14/moving-to-ruby-1-9/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 05:26:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=598</guid>
		<description><![CDATA[I&#8217;ve been using the Ruby 1.8.6 on my CentOS box and Ruby 1.8.7 on my Ubuntu and OS X computers, for a couple of years now; I&#8217;ve never payed much attention on continuing to hack Ruby code using these versions of Ruby.
However, in reading DHH&#8217;s tweet stating that Ruby 1.8X series is now considered legacy [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the Ruby 1.8.6 on my CentOS box and Ruby 1.8.7 on my Ubuntu and OS X computers, for a couple of years now; I&#8217;ve never payed much attention on continuing to hack Ruby code using these versions of Ruby.<br />
However, in reading DHH&#8217;s tweet stating that Ruby 1.8X series is now considered legacy and should be avoided and in reading through some of the Metasploit Framework initial documentation, I&#8217;ve decided to migrate to the latest Ruby 1.9 build (Ruby 1.9.2 patch level 180, at the time of this writing).</p>
<p>Upgrading was really easy, essentially on both CentOS and on Ubuntu I installed Ruby 1.9 directly from source, while I was able to install Ruby 1.9 on the Mac using Mac Ports.</p>
<p>The only thing that problem that I noticed in doing this, is that my existing Rubygems installation crapped out, which really isn&#8217;t a problem since I was able to successfully install a new version of Rubygems. So far the only incompatibilty that I have noticed so far is the Crypt gem which is not yet been updated to work with Ruby 1.9. There is an unofficial port called Crypt19, buts it&#8217;s such horribly undocumented (giving the library implementation is not helpful) that I couldn&#8217;t get my existing scripts to work using this library. </p>
<p>Now hopefully I&#8217;ll find more features on Ruby 1.9 that are worth doing the upgrade.</p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/04/14/moving-to-ruby-1-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby cli_mailer</title>
		<link>http://abaltazar.org/2011/02/26/ruby-cli_mailer/</link>
		<comments>http://abaltazar.org/2011/02/26/ruby-cli_mailer/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 08:12:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[linux/unix]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=540</guid>
		<description><![CDATA[After much nights of Ruby programming and many revisions, I finally manage to have an beta release of Ruby cli_mailer.
I originally planned on writing a full mail (Unix command line email client) like program in Ruby. Though I was able to have an almost identical console interface to mail&#8217;s reading, viewing, and deleting emails, using [...]]]></description>
			<content:encoded><![CDATA[<p>After much nights of Ruby programming and many revisions, I finally manage to have an beta release of Ruby cli_mailer.</p>
<p>I originally planned on writing a full mail (Unix command line email client) like program in Ruby. Though I was able to have an almost identical console interface to mail&#8217;s reading, viewing, and deleting emails, using POP. I was having a really hard time, keeping the connection alive after a certain number of seconds after initiating the connection.</p>
<p>So instead of having the incoming POP email client like usage that mail provides, I instead wrote the application to only support the mail sending features almost similar to mailx.</p>
<p>I would think developers or anyone wanting to send email from a Linux/Unix server without the hassle of sendmail, postfix, exim, etc&#8230; may find this simple program useful. I know I do, since I always find myself wanting to easily send emails from the command line whenever I&#8217;m using or doing some sort of testing on a Virtual Machine.</p>
<p>If you&#8217;ve ever used mail on a Linux/Unix system to send email messages, Ruby cli_mailer is practically identical.</p>
<p>Basic Usage:<br />
 Will get prompt to write email message that gets sends to root@rubyninja.net and blinds copy ccemailaddress@rubyninja.org<br />
<code><br />
rcli_mailer.rb -s 'Title of message' -c ccemailaddress@rubyninja.org root@rubyninja.net<br />
</code><br />
Will email the contents of sendmail.cf to root@rubyninja.net<br />
<code><br />
cat /etc/mail/sendmail.cf | rcli_mailer.rb -s 'God help me' root@rubyninja.net<br />
  </code><br />
<code><br />
rcli_mailer.rb -s "I'm so sorry" -c jrsysadmin@rubyninja.net root@rubyninja.net < /etc/postfix/main.cf<br />
</code><br />
NOTE: Ctrl-D is NOT supported by Ruby cli_mailer at the moment, you'll need to use the '.' (dot) character<br />
to send the email message.</p>
<p>I tried to make Ruby cli_mailer as moduler as possible, since I'm planning adding the project to github, and I already have in mind more features to add into it.</p>
<p>Enjoy <img src='http://abaltazar.org/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<a href="http://www.abaltazar.org/scripts/rcli_mailer-01.tar.gz">rcli_mailer-01.tar.gz</a></p>
<p>Documentation<br />
<a href="http://www.rubyninja.net/rcli_mailer-01/">rdoc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2011/02/26/ruby-cli_mailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phusion Passenger = good stuff</title>
		<link>http://abaltazar.org/2010/11/12/phusion-passenger-good-stuf/</link>
		<comments>http://abaltazar.org/2010/11/12/phusion-passenger-good-stuf/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 06:30:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=342</guid>
		<description><![CDATA[While mod_ruby is perfect to serve dynamic Ruby web pages, the project looks like its long dead; given that it hasn&#8217;t been updated for over 4 years now. Now the de facto way to deploy Ruby on Rails applications is Phusion Passenger. Compared to mod_ruby, configuring the Phusion Passenger (mod_rails) Apache module is ridiculously easy [...]]]></description>
			<content:encoded><![CDATA[<p>While mod_ruby is perfect to serve dynamic Ruby web pages, the project looks like its long dead; given that it hasn&#8217;t been updated for over 4 years now. Now the de facto way to deploy Ruby on Rails applications is Phusion Passenger. Compared to mod_ruby, configuring the Phusion Passenger (mod_rails) Apache module is ridiculously easy to do. Essentially all I had to do is download and install the gem. </p>
<p>The only quirk, which was entirely my fault for being lazy, was not reading the portion of the documentation where it mentions that the default environment is set to production. This gave me quite a headache as I couldn&#8217;t figure out why I had to restart Apache every time I modified any controller code (RoR noob).</p>
<p>My fix:<br />
.htaccess<br />
RailsEnv development</p>
<p>I&#8217;m amazed on Phusion&#8217;s work, the company responsible for the module. As they&#8217;ve take something that&#8217;s been historically difficult to deploy (at least I think) and made it really simple.<br />
<a href="http://www.modrails.com/">http://www.modrails.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2010/11/12/phusion-passenger-good-stuf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDoc: Documenting Ruby scripts</title>
		<link>http://abaltazar.org/2010/10/11/rdoc-documenting-ruby-scripts/</link>
		<comments>http://abaltazar.org/2010/10/11/rdoc-documenting-ruby-scripts/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 06:36:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=442</guid>
		<description><![CDATA[RDoc makes documenting Ruby scripts be really simple. RDoc is fairly simple to use, as it has a straight forward SimpleMarkup syntax which the RDoc utility uses to traverse the entire Ruby script and automatically generate pretty html documentation pages.
Now I have documentation for the dead simple Ruby script that I wrote to encode videos [...]]]></description>
			<content:encoded><![CDATA[<p>RDoc makes documenting Ruby scripts be really simple. RDoc is fairly simple to use, as it has a straight forward SimpleMarkup syntax which the RDoc utility uses to traverse the entire Ruby script and automatically generate pretty html documentation pages.</p>
<p>Now I have documentation for the dead simple Ruby script that I wrote to encode videos for my iphone.<br />
<a href="http://www.rubyninja.net/doc">iphone_encode.rb documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2010/10/11/rdoc-documenting-ruby-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What’s in my bookshelf?</title>
		<link>http://abaltazar.org/2010/09/14/what%e2%80%99s-in-my-bookshelf-2/</link>
		<comments>http://abaltazar.org/2010/09/14/what%e2%80%99s-in-my-bookshelf-2/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 06:39:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=353</guid>
		<description><![CDATA[
I finally finished reading my first book on Ruby programming. Ruby: Visual QuickStart Guide, by Larry Ullman has to be the perfect introduction book for anyone trying to learn the Ruby programming language, even though sadly it only has 3 five star reviews on Amazon. The author writing thoroughly explains the concepts in a friendly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://abaltazar.org/wordpress/wp-content/uploads/2010/08/visual_ruby.jpg"><img class="alignleft size-medium wp-image-354" title="visual_ruby" src="http://abaltazar.org/wordpress/wp-content/uploads/2010/08/visual_ruby-225x300.jpg" alt="" width="225" height="300" /></a><br />
I finally finished reading my first book on Ruby programming. Ruby: Visual QuickStart Guide, by Larry Ullman has to be the perfect introduction book for anyone trying to learn the Ruby programming language, even though sadly it only has 3 five star reviews on Amazon. The author writing thoroughly explains the concepts in a friendly and easy to understand manner.  This being the third book that I&#8217;ve read from this same author, the other titles being for <a href="http://www.amazon.com/MySQL-Second-Larry-Ullman/dp/0321375734/ref=sr_1_12?ie=UTF8&#038;s=books&#038;qid=1284532161&#038;sr=8-12">MySQL</a> and <a href="http://www.amazon.com/PHP-World-Wide-Web-Third/dp/0321442490/ref=pd_bxgy_b_img_a">PHP</a> (no reviews on these yet since I&#8217;m not fully finished reading them). </p>
<p>One thing I would&#8217;ve like changed the author to change was on the database chapter, as it was mainly focused on SQLite. It would have been better if the author used MySQL instead. Also it would have been better if the author removed the dedicated chapter to Rails, and instead extended the chapter to have more generic web related like Net::HTTP, given how powerful that single class is. </p>
<p>Chapter 1: Getting Started<br />
Chapter 2: Simple Scripts<br />
Chapter 3: Simple Types<br />
Chapter 4: Array, Ranges, and Hashes<br />
Chapter 5: Control structures<br />
Chapter 6: Creating Methods<br />
Chapter 7: Creating Classes<br />
Chapter 8: Inheritance and More<br />
Chapter 9: Modules and Includes<br />
Chapter 10: Regular Expressions<br />
Chapter 11: Debugging and Error Handling<br />
Chapter 12: Rubygems<br />
Chapter 13: Directories and Files<br />
Chapter 14: Databases<br />
Chapter 15: Networking<br />
Chapter 16: Ruby on Rails<br />
Chapter 17: Dynamic Programing</p>
<p>I would highly recommended this book to anybody starting or wanting to learn Ruby.<br />
<a href="http://www.amazon.com/Ruby-Visual-QuickStart-Larry-Ullman/dp/0321553853">Ruby-Visual-QuickStart</a><br />
4/5</p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2010/09/14/what%e2%80%99s-in-my-bookshelf-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-enabling mod_ruby on perlninja.pl</title>
		<link>http://abaltazar.org/2010/08/08/re-enabling-mod_ruby-on-perlninja-pl/</link>
		<comments>http://abaltazar.org/2010/08/08/re-enabling-mod_ruby-on-perlninja-pl/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 05:16:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://abaltazar.org/?p=325</guid>
		<description><![CDATA[I finally managed to re-enable mod_ruby on my server once again. This time around, I had a hard time enabling eRuby to work in Apache.
New Apache configuration file:
 

AddType text/html .rhtml
LoadModule ruby_module modules/mod_ruby.so
#&#60;IfModule mod_ruby.c&#62;
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run
&#60;Files *.rb&#62;
Options +ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
&#60;/Files&#62;
&#60;Files *.rhtml&#62;
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
&#60;/Files&#62;
#&#60;/IfModule&#62;

The Apache eRuby SetHandler (rhtml) was not able to render any html/ruby pages, [...]]]></description>
			<content:encoded><![CDATA[<p>I finally managed to re-enable mod_ruby on my server once again. This time around, I had a hard time enabling eRuby to work in Apache.</p>
<p>New Apache configuration file:</p>
<p><code> </code></p>
<p><code></p>
<div id="_mcePaste">AddType text/html .rhtml</div>
<div id="_mcePaste">LoadModule ruby_module modules/mod_ruby.so</div>
<div id="_mcePaste">#&lt;IfModule mod_ruby.c&gt;</div>
<div id="_mcePaste">RubyRequire apache/ruby-run</div>
<div id="_mcePaste">RubyRequire apache/eruby-run</div>
<div id="_mcePaste">&lt;Files *.rb&gt;</div>
<div id="_mcePaste">Options +ExecCGI</div>
<div id="_mcePaste">SetHandler ruby-object</div>
<div id="_mcePaste">RubyHandler Apache::RubyRun.instance</div>
<div id="_mcePaste">&lt;/Files&gt;</div>
<div id="_mcePaste">&lt;Files *.rhtml&gt;</div>
<div id="_mcePaste">SetHandler ruby-object</div>
<div id="_mcePaste">RubyHandler Apache::ERubyRun.instance</div>
<div id="_mcePaste">&lt;/Files&gt;</div>
<div id="_mcePaste">#&lt;/IfModule&gt;</div>
<p></code></p>
<p>The Apache eRuby SetHandler (rhtml) was not able to render any html/ruby pages, while regular ruby scripts (.*rb) were able to run just fine.</p>
<p>Apache log error:<br />
[Sun Aug 08 20:56:15 2010] [error] mod_ruby: (eval):45: (eval):45: uninitialized constant Apache::ERubyRun (NameError)</p>
<p><strong>FIX:</strong></p>
<p>Specify the absolute path to the eRuby Apache module in <strong>/usr/lib/ruby/1.8/apache/eruby-run.rb</strong>.</p>
<p>Change  line 45</p>
<p>require &#8216;eruby&#8217;</p>
<p>to</p>
<p>require &#8220;/usr/lib/ruby/1.8/i386-linux/eruby.so&#8221;</p>
<p>Restart Apache and eRuby should render html/ruby pages as expected.</p>
<p>I hope people find this useful (and save a headache) as I spent about 5 hours researching this problem and I wasn&#8217;t able to find this fix anywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://abaltazar.org/2010/08/08/re-enabling-mod_ruby-on-perlninja-pl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

