<?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>Pass By Value &#187; cygwin</title>
	<atom:link href="http://passbyvalue.com/tag/cygwin/feed/" rel="self" type="application/rss+xml" />
	<link>http://passbyvalue.com</link>
	<description>... or is it pass by reference?</description>
	<lastBuildDate>Thu, 26 Jan 2012 03:09:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting Ruby to talk to Oracle with Cygwin</title>
		<link>http://passbyvalue.com/2009/01/getting-ruby-to-talk-to-oracle-with-cygwin/</link>
		<comments>http://passbyvalue.com/2009/01/getting-ruby-to-talk-to-oracle-with-cygwin/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:52:04 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.passbyvalue.com/?p=42</guid>
		<description><![CDATA[I need to be able to use Ruby to talk to Oracle databases to help us easily build scripts for maintenance and support. So, I started doing some googling and found ruby-oci8. Excellent! I&#8217;m also mainly PC bound so I needed to get this working on my cygwin installation. My entire Ruby environment is running [...]]]></description>
			<content:encoded><![CDATA[<p>I need to be able to use Ruby to talk to Oracle databases to help us easily build scripts for maintenance and support.  So, I started doing some googling and found <a href="http://ruby-oci8.rubyforge.org/">ruby-oci8</a>.  Excellent!</p>
<p>I&#8217;m also mainly PC bound so I needed to get this working on my <a href="http://www.cygwin.com/">cygwin</a> installation.  My entire Ruby environment is running through cygwin.</p>
<p>So I started through the installation instructions on the ruby-oci8 site but started to find it pretty confusing to follow for the cygwin-specific installation.  Finally, after a bit of trial and error, here are the steps I followed to get this baby humming:</p>
<ol>
<li>Download and unzip the Oracle Instant Client Basic and SDK packages.  I successfully did this with version 11.1.0.7.0.  The path I chose was:
<pre lang="dos">C:\oracle\instantclient_11_1</pre>
</li>
<li>Add the instant client to the front of your system path (through Control Panel &#8211;&gt; System)</li>
<li>Launch cygwin</li>
<li>Install the gem
<pre lang="bash">$ gem install ruby-oci8
Building native extensions.  This could take a while...
Successfully installed ruby-oci8-1.0.3
1 gem installed
Installing ri documentation for ruby-oci8-1.0.3...
Installing RDoc documentation for ruby-oci8-1.0.3...</pre>
</li>
</ol>
<p>That&#8217;s it!  You&#8217;re now all installed!  You&#8217;ll notice that the gem compiles some native extensions, this is why you need the instant client to be available in your path.</p>
<p>Now to give it a test run, open up and irb session and give it a go:</p>
<pre lang="ruby" escaped="true">irb(main):001:0&gt; require 'oci8'
=&gt; true
irb(main):002:0&gt; conn = OCI8.new('username', 'password', '//server:port/sid')
=&gt; #&lt;OCI8:0x7fdb3d44 @privilege=nil, @prefetch_rows=nil, @ctx=[0, #&lt;Mutex:0x7fdb3cf4&gt;, nil, 65535], @svc=#&lt;ocisvcctx:0x7fdb3ce0&gt;&gt;</pre>
<p>We have a connection!</p>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2009/01/getting-ruby-to-talk-to-oracle-with-cygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

