OCI-8 check fails on Wiondows XP, Ruby 1.9.3

81 views
Skip to first unread message

Javix

unread,
Jul 16, 2012, 11:23:05 AM7/16/12
to oracle-...@googlegroups.com
It's not the first time I trying to check a DB connection, it worked well on other PCs, but this time it failed.
Here is the story.
I could not istall all the needed gems because of firewall and proxy issues, so I downloaded all of them manually and installed with '-l ' option when running gem install command.
Here is the gems list:

actionmailer (3.2.6)
actionpack (3.2.6)
activemodel (3.2.6)
activerecord (3.2.6)
activerecord-oracle_enhanced-adapter (1.4.1)
activeresource (3.2.6)
activesupport (3.2.6)
arel (3.0.2)
builder (3.0.0)
erubis (2.7.0)
faker (1.0.1)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
jruby-win32ole (0.8.5)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rake (0.9.2.2)
ruby-oci8 (2.1.2 x86-mingw32)
rubyzip (0.9.9)
sprockets (2.1.3)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)

So to check if everything is OK, I ran:

ruby -rubygems -e "require 'oci8'; OCI8.new('username','password','database').exec('select * from dual') do |r| puts r.join(','); end"

and got the below error:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- oci8 (LoadError
)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from -e:1:in `<main>'

Any idea on what is wrong there?

Thank you.

Javix

unread,
Jul 17, 2012, 5:53:37 AM7/17/12
to oracle-...@googlegroups.com
The solution I found is strange enough. I uninstalled removed the JRuby1.7.0.preview. It resulted in removing the active_record_enhanced adapter as well as ruby-oci8 gem; So I reinstalled these 2 gems again locally and it worked as needed.

Bill Burton

unread,
Jul 17, 2012, 9:05:29 AM7/17/12
to oracle-...@googlegroups.com
Hello,

On Tue, Jul 17, 2012 at 5:53 AM, Javix <s.ca...@gmail.com> wrote:
The solution I found is strange enough. I uninstalled removed the JRuby1.7.0.preview. It resulted in removing the active_record_enhanced adapter as well as ruby-oci8 gem; So I reinstalled these 2 gems again locally and it worked as needed.

In actuality, it's likely you had a problem with your Path such that JRuby was first and MRI 1.9.3 was second so the gem command was updating your JRuby not MRI Ruby installation.  With JRuby, the included commands all have a "j" prefix, e.g. jruby, jirb jgem, etc.  so if you put JRuby in your Path after MRI Ruby, you can use the "j" commands to access JRuby and the normal commands to access MRI Ruby.

However, for handling multiple versions and types of Ruby interpreters on Windows, consider installing pik[1] which supports easily switching between Rubies by updating Path and provides a simple way to install most any recent Ruby interpreter.


Hope this helps,
-Bill
Reply all
Reply to author
Forward
0 new messages