<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gnana Prasad Ruby</title>
	<atom:link href="http://gnanaruby.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnanaruby.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 08 May 2008 08:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='gnanaruby.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Gnana Prasad Ruby</title>
		<link>http://gnanaruby.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://gnanaruby.wordpress.com/osd.xml" title="Gnana Prasad Ruby" />
	<atom:link rel='hub' href='http://gnanaruby.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Calendar date select plugin for rails</title>
		<link>http://gnanaruby.wordpress.com/2008/05/08/calendar-date-select-plugin-for-rails/</link>
		<comments>http://gnanaruby.wordpress.com/2008/05/08/calendar-date-select-plugin-for-rails/#comments</comments>
		<pubDate>Thu, 08 May 2008 07:59:02 +0000</pubDate>
		<dc:creator>gnanaruby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gnanaruby.wordpress.com/?p=10</guid>
		<description><![CDATA[We have been searching for a better date picker for one of my application. We found a rails plugin calendardateselect Its simply superb and work nicely in all most all browser. Installation is simple: 1. script/plugin install http://calendardateselect.googlecode.com/svn/tags/calendar_date_select Now, we just need to integrate it to your application. 2. First, in your layout/application.rb you need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=10&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have been searching for a better date picker for one of my application.</p>
<p>We found a rails plugin  <a href="http://code.google.com/p/calendardateselect/"><strong>calendardateselect</strong></a><strong> </strong>Its simply superb and work nicely in all most all browser.</p>
<p>Installation is simple:</p>
<p><code><strong>1. </strong>script/plugin install    http://calendardateselect.googlecode.com/svn/tags/calendar_date_select</code></p>
<p>Now, we just need to integrate it to your application.</p>
<p><strong>2. </strong>First, in your layout/application.rb you need to add the javascript tag:</p>
<p><code>&lt;%= calendar_date_select_includes "silver" %&gt;</code></p>
<p>You can also use “red”, “blue” ,&#8221;plain&#8221;or “nil” for other color schemes.</p>
<p><strong>3.</strong> Also note that you need to have prototype included as well, so if you haven’t already, you should also add the following to your layout:</p>
<p><code>&lt;%= javascript_include_tag :defaults %&gt;</code></p>
<p>and its ready to use it !!!</p>
<p>and its ready to use it, i was using to capture a persons date_of_birth as follows</p>
<p><code><strong>4.</strong> &lt;%= calendar_date_select_tag "person[date_of_birth]" %&gt;</code></p>
<p>If you want more features of the calendar date select plugin ,Please visit  <a href="http://www.restatesman.com/static/calendar">calendar date select demos</a> <img src="http://www.rubyinside.com/wp-content/uploads/2007/08/calendardateselect.jpg" alt="" /></p>
<p><strong>5. </strong>If you want to change the default syntax of the calendar data select plugin add the following line to your copnfig/enivnorment.rb file below</p>
<p><code> CalendarDateSelect.format = :american</code></p>
<p>want to learn more about the  DATE FORMATS supported  by this plugin, Please digg the plugin code.It supports maximun FORAMTS.</p>
<p><strong>6. </strong>This plugin allows a few more configuration options available for the calendar. You can find out more and get some screenshots by visiting the project’s <a href="http://code.google.com/p/calendardateselect/">homepage</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gnanaruby.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gnanaruby.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gnanaruby.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gnanaruby.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gnanaruby.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=10&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gnanaruby.wordpress.com/2008/05/08/calendar-date-select-plugin-for-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63cf13115409a7a4a23738dc18449adf?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gnanaruby</media:title>
		</media:content>

		<media:content url="http://www.rubyinside.com/wp-content/uploads/2007/08/calendardateselect.jpg" medium="image" />
	</item>
		<item>
		<title>Git &#8211;  Fast Version Control System</title>
		<link>http://gnanaruby.wordpress.com/2008/04/28/git-fast-version-control-system-2/</link>
		<comments>http://gnanaruby.wordpress.com/2008/04/28/git-fast-version-control-system-2/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 10:53:12 +0000</pubDate>
		<dc:creator>gnanaruby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gnanaruby.wordpress.com/?p=8</guid>
		<description><![CDATA[Git is an open source version control system designed to handle very large projects with speed and efficiency, but just as well suited for small personal repositories; it is especially popular in the open source community, serving as a development platform for projects like the Linux Kernel, WINE or X.org. Git falls in the category [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=8&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="text-align:justify;"><span> </span><strong>Git</strong> is an <strong>open source version control system</strong> designed to handle very large projects with speed and efficiency, but just as well suited for small personal repositories; it is especially popular in the open source community, serving as a development platform for projects like the <em>Linux Kernel</em>, <em>WINE</em> or <em>X.org</em>.</p>
<p class="MsoNormal" style="text-align:justify;"><span> </span>Git falls in the category of distributed source code management tools, similar to e.g. <em>Mercurial</em> or <em>Bazaar</em>. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Still, Git stays extremely fast and space efficient.</p>
<p class="MsoNormal" style="text-align:justify;"><strong>About GIT:</strong></p>
<p class="MsoNormal" style="margin-left:30pt;text-align:justify;text-indent:-0.25in;"><!--[if !supportLists]--><span>-<span> </span></span><!--[endif]--><strong>Distributed development</strong></p>
<p class="MsoNormal" style="margin-left:30pt;text-align:justify;text-indent:-0.25in;"><!--[if !supportLists]--><span>-<span> </span></span><!--[endif]--><strong>Strong supprt for non-linear development</strong></p>
<p class="MsoNormal" style="margin-left:30pt;text-align:justify;text-indent:-0.25in;"><!--[if !supportLists]--><span>-<span> </span></span><!--[endif]--><strong>Efficient handling of large projects</strong></p>
<p class="MsoNormal" style="margin-left:30pt;text-align:justify;text-indent:-0.25in;"><!--[if !supportLists]--><span>-<span> </span></span><!--[endif]--><strong>Cryptographic authentication of history</strong></p>
<p class="MsoNormal" style="text-align:justify;"><!--[if !supportLists]--><span>-<span> </span></span><!--[endif]--><strong>Toolkit design</strong></p>
<p class="MsoNormal" style="text-align:justify;"><strong>Documentation</strong>:</p>
<p class="MsoNormal" style="text-align:justify;"><span> </span><span> </span><span> </span>Please visit the following URL: <span> </span><span> </span><a href="http://www.kernel.org/pub/software/scm/git/docs/tutorial.html">http://www.kernel.org/pub/software/scm/git/docs/tutorial.html</a></p>
<p class="MsoNormal" style="text-align:justify;">For more information and to download GIT Source package <span> </span>please visit the following link</p>
<p class="MsoNormal" style="text-align:justify;"><strong><span> </span><a href="http://git.or.cz/">http://git.or.cz/</a></strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gnanaruby.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gnanaruby.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gnanaruby.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gnanaruby.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gnanaruby.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=8&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gnanaruby.wordpress.com/2008/04/28/git-fast-version-control-system-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63cf13115409a7a4a23738dc18449adf?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gnanaruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to a Microsoft SQL Server from a Rails Application</title>
		<link>http://gnanaruby.wordpress.com/2008/04/28/connecting-to-a-microsoft-sql-server-from-a-rails-application/</link>
		<comments>http://gnanaruby.wordpress.com/2008/04/28/connecting-to-a-microsoft-sql-server-from-a-rails-application/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 10:33:26 +0000</pubDate>
		<dc:creator>gnanaruby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gnanaruby.wordpress.com/?p=5</guid>
		<description><![CDATA[This is just a quick note for those of you that have a Ruby on Rails application that you are connecting up to Microsoft SQL server for your database. Step 1) Download the latest ruby-dbi package Rails has a database independent interface (DBI) that can be downloaded from RubyForge Step 2) After downloading extract the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=5&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">This is just a quick note for those of you that have a Ruby on Rails application that you are connecting up to Microsoft SQL server for your database.</p>
<p class="MsoNormal">
<h2><span style="font-size:12pt;">Step 1) </span><span style="font-size:12pt;">Download the latest</span><span style="font-size:12pt;"> </span><strong><span style="font-size:12pt;font-style:normal;">ruby-dbi</span></strong><span style="font-size:12pt;"><span> </span></span><span style="font-size:12pt;">package</span></h2>
<p class="MsoNormal"><span> </span>Rails has a database independent interface (<strong>DBI</strong>) that can be downloaded from <a href="http://rubyforge.org/projects/ruby-dbi/">RubyForge</a></p>
<p class="MsoNormal">
<p class="MsoNormal"><strong>Step 2)</strong><span> </span>After downloading extract the<span> </span><a href="http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz">dbi-&lt;latest version&gt;.tar.gz</a><span> </span>(Example : <a href="http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz">dbi-0.1.1.tar.gz</a> )</p>
<p class="MsoNormal">
<p class="MsoNormal">Step 3) Copy the file <strong>ADO.rb</strong> file from<span> </span></p>
<p class="MsoNormal"><span> </span></p>
<pre><span>                     </span><span> </span><span style="font-size:12pt;">bdi-0.1.0/lib/dbd/ADO.rb</span>
<strong><span style="font-size:12pt;"><span>                              </span>To </span></strong>
<strong><span style="font-size:12pt;"> </span></strong>
<strong><span style="font-size:12pt;"><span>                       </span></span></strong><span style="font-size:12pt;"><span> </span>c:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb</span>
<strong><span style="font-size:12pt;"> </span></strong>
<strong><span style="font-size:12pt;">NOTE: The ADO directory does not exist on a standard install; you will need to create it.</span></strong>
<strong><span style="font-size:12pt;"> </span></strong></pre>
<p><strong>Step 4) </strong><strong><span style="font-weight:normal;">Copy</span></strong> the <strong>sqlserver_adapter.rb </strong>file into the ruby installed gems path as specified below:<span> </span></p>
<pre><span style="font-size:12pt;"><span>    </span>C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.0.2\lib\active_record\connection_adapters\</span></pre>
<p><strong> </strong></p>
<p><strong>Step 5) </strong>Then simply set up your railsapp/config/database.yml</p>
<p>Here’s an example for reference:</p>
<pre><strong><span style="font-size:12pt;">development:</span></strong>
<strong><span style="font-size:12pt;"><span>  </span>adapter: </span></strong><span style="font-size:12pt;">sqlserver</span>
<strong><span style="font-size:12pt;"><span>  </span>database: </span></strong><span style="font-size:12pt;">database_name<strong></strong></span>
<strong><span style="font-size:12pt;"><span>  </span>host: </span></strong><span style="font-size:12pt;">server_name</span>
<strong><span style="font-size:12pt;"><span>  </span>username: </span></strong><span style="font-size:12pt;">user_name<strong></strong></span>
<strong><span style="font-size:12pt;"><span>  </span>password: </span></strong><span style="font-size:12pt;">your_pw_here<strong></strong></span></pre>
<p class="MsoNormal">
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gnanaruby.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gnanaruby.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gnanaruby.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gnanaruby.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gnanaruby.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=5&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gnanaruby.wordpress.com/2008/04/28/connecting-to-a-microsoft-sql-server-from-a-rails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63cf13115409a7a4a23738dc18449adf?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gnanaruby</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to Oracle from Ruby on Rails</title>
		<link>http://gnanaruby.wordpress.com/2008/04/25/connecting-to-oracle-from-ruby-on-rails/</link>
		<comments>http://gnanaruby.wordpress.com/2008/04/25/connecting-to-oracle-from-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 11:26:56 +0000</pubDate>
		<dc:creator>gnanaruby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[1) What do I need to install to run Ruby on Rails using Oracle Database? The minimum installation for an RoR Web application that integrates with Oracle Database must include the following: Oracle SQL*Plus or Oracle Instant Client software Ruby Gem OCI8 Rails 2) What is Oracle Instance Client? Oracle Instant Client is software that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=1&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p></p>
<h3 style="text-align:justify;"><span style="font-size:14pt;">1) What do I need to install to run Ruby on Rails using Oracle Database?</span></h3>
<p style="text-align:justify;">The minimum installation for an RoR Web application that integrates with Oracle Database must include the following:</p>
<ul type="disc">
<li class="MsoNormal">Oracle      SQL*Plus or Oracle Instant Client software</li>
<li class="MsoNormal">Ruby</li>
<li class="MsoNormal">Gem</li>
<li class="MsoNormal">OCI8</li>
<li class="MsoNormal">Rails</li>
</ul>
<h3 style="text-align:justify;"><span style="font-size:14pt;">2) What is Oracle Instance Client?</span></h3>
<p>Oracle Instant Client is software that lets you run your applications without installing the standard Oracle client or having an ORACLE_HOME. You can find a description of the software, download the file, and get installation instructions here: <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html">http://www.oracle.com/technology/tech/oci/instantclient/index.html</a></p>
<p style="text-align:justify;"><span> </span>Strictly speaking, you don’t need SQL*Plus to run Rails applications. There are Rails-based methods (such as migrations) of creating and maintaining database schemas.</p>
<h3 style="text-align:justify;"><a name="3-2"></a><span style="font-size:14pt;">3) What is OCI8?</span></h3>
<p style="text-align:justify;">The Ruby/Oracle Call Interface (OCI8) is a database driver for Ruby/DBI. RubyDBI provides a database-independent interface for Ruby. You install OCI8 to provide a Ruby interface to the underlying Oracle client software. It’s somewhat analogous to ODBC or JDBC.</p>
<h3 style="text-align:justify;"><span style="font-size:14pt;">4) How can I test OCI8 connectivity?</span></h3>
<h2 style="text-align:justify;"><span style="font-size:12pt;font-weight:normal;"><span> </span></span><span style="font-size:12pt;font-weight:normal;">In</span><span style="font-weight:normal;"> </span><span style="font-size:12pt;font-weight:normal;">order to connect to Oracle, you need to install the Ruby/Oracle Call Interface (OCI8) library, which is a database driver based on </span><span style="font-size:12pt;">Ruby/DBI</span><span style="font-size:12pt;font-weight:normal;"> (Database Interface module).</span></h2>
<h2 style="text-align:justify;"><span style="font-size:9pt;"><span> </span></span><span style="font-size:12pt;">RubyDBI</span><span style="font-size:12pt;font-weight:normal;"> provides a database-independent interface for Ruby to talk to databases similar to JDBC or ODBC. The Ruby OCI8 driver provides connectivity to Oracle versions 8 through 10 via standard Oracle Client software. OCI8 is a Ruby wrapper written around native C code which does the actual interaction.</span></h2>
<h2 style="text-align:justify;"><span style="font-size:12pt;"><span> </span>ruby-oci8</span><span style="font-size:12pt;font-weight:normal;"> is a ruby interface for <a href="http://www.oracle.com/">Oracle Database</a>. This is available with Oracle8, Oracle8i, Oracle9i, Oracle10g, <a href="http://www.oracle.com/technology/products/database/xe/index.html">Oracle XE</a> and <a href="http://ruby-oci8.rubyforge.org/en/InstallForInstantClient.html">Oracle Instant Client</a></span></h2>
<h2 style="text-align:justify;"><span style="font-size:12pt;font-weight:normal;">To download and install Oracle Rails library, go to<span> </span><a href="http://rubyforge.org/projects/ruby-oci8">http://rubyforge.org/projects/ruby-oci8</a>,</span></h2>
<h2 style="text-align:justify;"><span style="font-size:12pt;font-weight:normal;">Download </span><span style="font-size:12pt;">ruby-oci8-0.1.13-mswin.rb</span><span style="font-size:12pt;font-weight:normal;"> to your C drive, and then using your command window, execute the following command.</span></h2>
<pre style="text-align:justify;"><strong><span style="font-size:16pt;"><span>                      </span></span></strong><strong></strong>
<strong><span style="font-size:12pt;">C:\&gt;ruby ruby-oci8-0[1].1.13-mswin.rb</span></strong>
<strong><span style="font-size:12pt;"> </span></strong>
<span style="font-size:12pt;">Copy OCI8.rb to c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8</span>
<span style="font-size:12pt;">Copy oci8.rb to c:/ruby/lib/ruby/site_ruby/1.8</span>
<span style="font-size:12pt;">Copy oci8lib.so to c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt</span>
<span style="font-size:12pt;">OK?</span>
<span style="font-size:12pt;">Enter Yes/No: Yes</span>
<span style="font-size:12pt;">Copying OCI8.rb to c:/ruby/lib/ruby/site_ruby/1.8/DBD/OCI8 ... done</span>
<span style="font-size:12pt;">Copying oci8.rb to c:/ruby/lib/ruby/site_ruby/1.8 ... done</span>
<span style="font-size:12pt;">Copying oci8lib.so to c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt ... done</span>
<span style="font-size:12pt;">OK</span></pre>
<pre style="text-align:justify;"><strong><span style="font-size:12pt;"> </span></strong></pre>
<pre style="text-align:justify;"><strong><span style="font-size:12pt;">Note:</span></strong><span style="font-size:12pt;"> To do a simple test to see if you are able to connect to the Oracle database server.

Run the following command on the command line with the specified fields like Username, 

Password, Net service name</span></pre>
<pre style="text-align:justify;"><span> </span>
<strong><span>ruby -r oci8 -e "OCI8.new('&lt;user_name&gt;', '&lt;password&gt;', 'NET_SERVICE_NAME').exec('SELECT * FROM jobs ORDER BY 1') do |r| </span></strong>
<strong><span>puts r.join(' | '); end"</span></strong></pre>
<pre style="text-align:justify;"><strong><span style="font-size:12pt;"> </span></strong></pre>
<pre style="text-align:justify;"><strong><span style="font-size:12pt;">Note: &lt;user_name&gt;: </span></strong><span style="font-size:12pt;">User name of your Oracle database</span>
<strong><span style="font-size:12pt;"><span>     </span><span> </span>&lt;password&gt;:</span></strong><span style="font-size:12pt;"> Password of your Oracle database</span>
<strong><span style="font-size:12pt;"><span>      </span>&lt;net_service_name&gt;: </span></strong><span style="font-size:12pt;">Service name which given in<strong> TNSNAMES.ora</strong> file</span>
<span style="font-size:12pt;"> </span>
<strong><span style="font-size:12pt;">TNSNAMES.ora:</span></strong><span style="font-size:12pt;"><span>  </span>I</span><span style="font-size:12pt;">s a <a title="SQL*Net" href="http://www.orafaq.com/wiki/SQL%2ANet">SQL*Net</a> configuration file that defines databases addresses for establishing
connections to them. This file normally resides in the <a title="ORACLE HOME" href="http://www.orafaq.com/wiki/ORACLE_HOME">ORACLE HOME</a>\NETWORK\ADMIN directory.</span></pre>
<p style="text-align:justify;">If the connection and query were successful, the output should look something like this:</p>
<pre style="text-align:justify;"><span>AC_ACCOUNT | Public Accountant<span>  </span>| 4200 | 9000</span></pre>
<pre style="text-align:justify;"><span>AC_MGR | Accounting Manager<span>  </span>| 8200 | 16000</span></pre>
<pre style="text-align:justify;"><span>AD_ASST | Administration<span>  </span>Assistant | 3000 | 6000</span></pre>
<pre style="text-align:justify;"><span>AD_PRES | President | 20000<span>  </span>| 40000</span></pre>
<pre style="text-align:justify;"><span>AD_VP | Administration Vice<span>  </span>President | 15000 | 30000</span></pre>
<pre style="text-align:justify;"><span>FI_ACCOUNT | Accountant |<span>  </span>4200 | 9000</span></pre>
<pre style="text-align:justify;"><span>FI_MGR | Finance Manager |<span>  </span>8200 | 16000</span></pre>
<pre style="text-align:justify;"><span>HR_REP | Human Resources<span>  </span>Representative | 4000 | 9000</span></pre>
<pre style="text-align:justify;"><span>IT_PROG | Programmer | 4000<span>  </span>| 10000</span></pre>
<pre style="text-align:justify;"><span>MK_MAN | Marketing Manager<span>  </span>| 9000 | 15000</span></pre>
<pre style="text-align:justify;"><span>MK_REP | Marketing<span>  </span>Representative | 4000 | 9000</span></pre>
<pre style="text-align:justify;"><span>PR_REP | Public Relations<span>  </span>Representative | 4500 | 10500</span></pre>
<pre style="text-align:justify;"><span>PU_CLERK | Purchasing Clerk<span>  </span>| 2500 | 5500</span></pre>
<pre style="text-align:justify;"><span>PU_MAN | Purchasing Manager<span>  </span>| 8000 | 15000</span></pre>
<pre style="text-align:justify;"><span>SA_MAN | Sales Manager |<span>  </span>10000 | 20000</span></pre>
<pre style="text-align:justify;"><span>SA_REP | Sales<span>  </span>Representative | 6000 | 12000</span></pre>
<pre style="text-align:justify;"><span>SH_CLERK | Shipping Clerk |<span>  </span>2500 | 5500</span></pre>
<pre style="text-align:justify;"><span>ST_CLERK | Stock Clerk |<span>  </span>2000 | 5000</span></pre>
<pre style="text-align:justify;"><span>ST_MAN | Stock Manager |<span>  </span>5500 | 8500</span></pre>
<h3 style="text-align:justify;"><a name="3-3"></a><span style="font-size:14pt;">5) How do I configure an Oracle TNSNAMES.ora entry?</span></h3>
<p style="text-align:justify;">The <strong>TNSNAMES.ora</strong> file is a plain-text file used by Oracle to determine the information needed to connect to a database. You’ll typically find it within the <strong>Oracle Home /network/admin</strong> directory. Every connection includes the server name (or IP address), the port where the Oracle Listener is running, and the name of the database in view.</p>
<p style="text-align:justify;">Here’s an example of a TNS entry that might appear in the file:</p>
<pre style="text-align:justify;"><span>ORCL =</span></pre>
<pre style="text-align:justify;"><span><span>  </span>(DESCRIPTION =</span></pre>
<pre style="text-align:justify;"><span><span>    </span>(ADDRESS_LIST =</span></pre>
<pre style="text-align:justify;"><span><span>      </span>(ADDRESS = (PROTOCOL = TCP)(HOST = server.company.com)(PORT = 1521))</span></pre>
<pre style="text-align:justify;"><span><span>    </span>)</span></pre>
<pre style="text-align:justify;"><span><span>    </span>(CONNECT_DATA =</span></pre>
<pre style="text-align:justify;"><span><span>      </span>(SERVICE_NAME = ORCL)</span></pre>
<pre style="text-align:justify;"><span><span>    </span>)</span></pre>
<pre style="text-align:justify;"><span><span>  </span>)</span></pre>
<p style="text-align:justify;">If you’re using Oracle Express Edition, an entry named XE will appear in this file, indicating the database that was created when you installed the software.</p>
<p style="text-align:justify;">To create a new TNS Entry, you can copy an existing entry and modify the database name, port number, and server name accordingly. Depending on your installation, you might also be able to perform the same task with the Oracle Net Configuration Assistant, which provides a GUI that will edit the file for you.</p>
<h3 style="text-align:justify;"><a name="3-4"></a><a name="3-5"></a><span style="font-size:14pt;">6) What is Oracle Easy Connect Naming?</span></h3>
<p style="text-align:justify;">If you don’t have a database entry specified in your Oracle TNSNAMES.ora, you can make a connection using easy connect naming.  This lets you connect to an Oracle database using only a TCP/IP connect string made up of a host name, port, and service name. You can run a test of OCI8 using Easy Connect Naming as follows (substituting the appropriate values for your password, server, port, and database):</p>
<pre style="text-align:justify;"><strong><span style="font-size:11pt;">ruby -r oci8 -e "OCI8.new('hr',<span>  </span>'hr_password', </span></strong></pre>
<pre style="text-align:justify;"><strong><span style="font-size:11pt;">'//server.company.com:1521/orcl').exec('SELECT * FROM jobs order<span>  </span>by 1) do |r| </span></strong></pre>
<pre style="text-align:justify;"><strong><span style="font-size:11pt;">puts r.join(' | '); end"</span></strong></pre>
<div class="MsoNormal" style="text-align:center;">
<hr size="2" /></div>
<h3 style="text-align:justify;"><a name="4"></a><a name="4-3"></a><a name="4-3-2"></a><a name="4-4"></a><span style="font-size:14pt;">7) How do I install oci8 on Linux?</span></h3>
<h4 style="text-align:justify;"><a name="4-4-1"></a><a name="4-4-3"></a><span style="font-size:12pt;"><span> </span>Install OCI8 </span></h4>
<pre style="text-align:justify;"><span style="font-size:12pt;">export ORACLE_HOME=</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;">tar -xzvf ruby-oci8-0\[1\].1.13.tar.gz </span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;">cd ruby-oci8-0.1.13</span></pre>
<p style="text-align:justify;">To display the three steps that need to be run, invoke the setup program (ruby setup.rb) and pass it zero parameters.</p>
<pre style="text-align:justify;"><span style="font-size:12pt;"># ruby setup.rb</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;">No task or global option given.</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;">Typical installation procedure is:</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;"><span>    </span>$ ruby setup.rb config</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;"><span>    </span>$ ruby setup.rb setup</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;"><span>    </span># ruby setup.rb install<span>  </span>(may require root privilege)</span></pre>
<pre style="text-align:justify;"><span style="font-size:12pt;">Try 'ruby setup.rb --help' for detailed usage.</span></pre>
<p style="text-align:justify;">You must run these three options in order. To verify that OCI8 and Rails were installed, follow the same steps as listed above for Windows.</p>
<h3 style="text-align:justify;"><a name="4-4-4"></a><a name="4-5"></a><span>Errors During Installation</span></h3>
<h4 style="text-align:justify;"><a name="4-5-1"></a><a name="4-5-2"></a><a name="4-5-3"></a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> How do I handle an error that says the service name cannot be resolved?</h4>
<p style="text-align:justify;">If you specify an ORACLE_SID that doesn’t exist in your tnsnames.ora, you’ll get an error message <tt><span style="font-size:10pt;">ORA-12154: TNS:could not resolve service name (OCIError)</span></tt>.</p>
<p style="text-align:justify;">The fact that an ORA- error was thrown shows that Ruby is communicating with the Oracle client. Remember that Ruby is using Oracle client software (or Instant Client) to make a connection. Make sure you have the correct connection information in your tnsnames.ora. If you have multiple Oracle Homes, make sure you configure the tnsnames.ora within the correct Oracle Home.</p>
<div class="MsoNormal" style="text-align:center;"><a name="4-5-4"></a></p>
<hr size="2" /></div>
<h3 style="text-align:justify;"><a name="5"></a><a name="5-1"></a><span style="font-size:14pt;">9) What are the Database Object Conventions required by Rails when using Oracle?</span></h3>
<p style="text-align:justify;">Rails is designed to use a number of conventions related to database objects. You can work around them (and you’ll need to when working with legacy databases), but adhering to them greatly speeds application development and results in code that’s easier to maintain. Two conventions are fundamental to Rails development:</p>
<ol type="1">
<li class="MsoNormal">Table      names should be plural. The table will map to a Model object that has the      same name but in the singular form.</li>
<li class="MsoNormal">A primary      key of type NUMBER named id should be created for each table. This column      will serve as the unique identifier used by Rails to retrieve records by      default. When using Oracle applications, create a sequence that uses the      table name followed by “_seq”.</li>
</ol>
<p style="text-align:justify;">A number of column names have special significance within a Rails application. The id column serves as the primary key, as mentioned above. Columns that contain ids for related tables are named in the format &lt;singular_form_of_table&gt;_id. A number of columns can be used to track the date and time at which records were changed (created_at, created_on, updated_at, updated_on). Other columns are available to count child records, perform Rails-controlled optimistic locking, and hierarchically categorize data (for use in lists and trees).</p>
<h3 style="text-align:justify;"><a name="5-2"></a><span style="font-size:14pt;">10) How do I create a basic Rails application?</span></h3>
<p style="text-align:justify;">Once you’ve installed the software, you can immediately begin developing your first Web application.</p>
<h4 style="text-align:justify;"><a name="5-2-1"></a><span style="font-size:13pt;">a) Configure the Database</span></h4>
<p style="text-align:justify;">Connect to the database you intend to use for the application through SQL*Plus and create your database objects.  See <em><a href="http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html#5-1">What are the Database Object Conventions required by Rails when using Oracle?</a></em></p>
<h4 style="text-align:justify;"><a name="5-2-2"></a><span style="font-size:13pt;">b) Create the Rails Web application </span></h4>
<p style="text-align:justify;">Navigate to working directory and create a Rails application:</p>
<pre style="text-align:justify;"><span style="font-size:12pt;">$ rails name_of_your_application</span></pre>
<p style="text-align:justify;">Subsequent commands will run scripts that are relative to the newly created application directory, so navigate to this directory using the following command:</p>
<pre style="text-align:justify;"><span style="font-size:12pt;">$ cd name_of_your_application</span></pre>
<h4 style="text-align:justify;"><span style="font-size:13pt;">c) Copy Oracle_adapter.rb to ruby installed gems path</span></h4>
<p></span></strong><span style="font-size:11.5pt;color:black;">Copy the <strong>oracle_adapter.rb </strong>file into the ruby installed gems path as specified below: </span></p>
<p><strong>  C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.0.2\lib\active_record\connection_adapters</strong></p>
<h4 style="text-align:justify;"><a name="5-2-3"></a><span style="font-size:13pt;">d) Configure the application to use the Database</span></h4>
<p>Edit the database.yml file found in the config directory. Delete the contents of the file and replace them with the Oracle-specific entries. Your file should look something like this:</p>
<p><strong>development:</strong><br />
adapter: ocihost: ORCL<br />
<strong># Name specified in a TNSNAMES.org file</strong><br />
username: *******<br />
password: *******<br />
<strong>test:</strong><br />
adapter: oci<br />
host: ORCL<br />
username: ******<br />
password: ******<br />
<strong>production:</strong><br />
adapter: oci<br />
host: PROD<br />
username: ********<br />
password: ********</p>
<h4 style="text-align:justify;"><a name="5-2-4"></a>6. Create the basic Model, Views, and Controller</h4>
<p style="text-align:justify;">Run the following command, which will create the scaffold (in essence, an entire skeleton Web application) based upon the table in the user schema:</p>
<pre style="text-align:justify;"><span style="font-size:12pt;">ruby script\generate scaffold model_name_here</span></pre>
<p style="text-align:justify;">Substitute the name of your model (the singular form of your table name) for model_name_here.</p>
<p style="text-align:justify;">This command created the Model, Views, and Controller for the Web application. The Model provides an object mapping to our underlying database table. The Controller will provide navigation between the various views and communication across the model. The Views will provide the interface that will let a user create, update, delete, and list records in the products table.</p>
<h4 style="text-align:justify;"><a name="5-2-5"></a>7. Test the newly created application</h4>
<p style="text-align:justify;line-height:12pt;">First, start the (included) Web server:</p>
<pre style="text-align:justify;line-height:12pt;"><span style="font-size:12pt;">ruby script\server</span></pre>
<p style="text-align:justify;line-height:12pt;">Now navigate to:  <a href="http://localhost:3000/plural_of_your_model_name_here">http://localhost:3000/plural_of_your_model_name_here</a></p>
<pre><span style="font-size:12pt;">A basic listing of the records in the table will appear.</p>
<p>
<strong>Thats All....Have a fun with oracle database</strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/gnanaruby.wordpress.com/1/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/gnanaruby.wordpress.com/1/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gnanaruby.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gnanaruby.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gnanaruby.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=gnanaruby.wordpress.com&amp;blog=3576107&amp;post=1&amp;subd=gnanaruby&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://gnanaruby.wordpress.com/2008/04/25/connecting-to-oracle-from-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/63cf13115409a7a4a23738dc18449adf?s=96&#38;d=identicon" medium="image">
			<media:title type="html">gnanaruby</media:title>
		</media:content>
	</item>
	</channel>
</rss>
