From: Will Raffaele on
Hello all,

I'm a newbie using Windows.

I'm trying to connect to Oracle to get started.

I made it thru a Proxy problem where none of my gems were loading.

Now I'm trying to to connect via Oracle.

I get the following message:

irb(main):001:0> require oci8
NameError: undefined local variable or method `oci8' for main:Object
from (irb):1
from :0

I have put environment variables of ORACLE_HOME, LD_LIBRARY_PATH, and
LD_LIBRARY_PATH32 pointing to C:\oracle\instantclient_11_1.

I've installed:

activerecord-oracle-adapter (1.0.0.9250)
activerecord-oracle_enhanced-adapter (1.2.4)

I did an install of oci8 from gem as in:

gem install ruby-oci8 -v 1.0.4

Previously tried to install from tar.

Any help is greatly appreciated.

Thanks,

Will R.
--
Posted via http://www.ruby-forum.com/.

From: Brian Candler on
Will Raffaele wrote:
> irb(main):001:0> require oci8
> NameError: undefined local variable or method `oci8' for main:Object
> from (irb):1
> from :0

require 'oci8' (you missed the quotes)

otherwise it thinks you're trying to use a local variable or method
called oci8, and it can't find one. Compare:

foo = 'oci8'
require foo
--
Posted via http://www.ruby-forum.com/.

From: Will Raffaele on
Yes, I tried it both ways:

irb(main):002:0> require 'oci8'
LoadError: no such file to load -- oci8lib_18
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/site_ruby/1.8/oci8.rb:25
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from (irb):2
from :0
irb(main):003:0> foo = 'oci8'
=> "oci8"
irb(main):004:0> require foo
LoadError: no such file to load -- oci8lib_18
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby/lib/ruby/site_ruby/1.8/oci8.rb:25
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from (irb):4
from :0
irb(main):005:0>
--
Posted via http://www.ruby-forum.com/.

From: KUBO Takehiro on
What version of ruby-oci8 do you use?
What type of ruby-oci8 package do you use?
Could you list *all* files whose name starts with oci8 under C:\Ruby?

On Tue, Mar 30, 2010 at 10:02 PM, Will Raffaele <wgr6(a)hotmail.com> wrote:
> irb(main):002:0> require 'oci8'
> LoadError: no such file to load -- oci8lib_18
>  from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>  from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
>  from C:/Ruby/lib/ruby/site_ruby/1.8/oci8.rb:25

You wrote 'gem install ruby-oci8 -v 1.0.4' but
C:/Ruby/lib/ruby/site_ruby/1.8/oci8.rb is
a part of ruby-oci8 2.0 because it requires oci8lib_18.
I guess that you mix some ruby-oci8 versions and package types.

From: Will Raffaele on
> Could you list *all* files whose name starts with oci8 under C:\Ruby?

C:\Ruby>dir oci8 /s
Directory of C:\Ruby\extract
03/26/2010 04:44 PM <DIR> oci8
Directory of C:\Ruby\extract\oci8\lib
03/26/2010 03:57 PM <DIR> oci8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\activerecord-oracle-adapter-1.0.0.92
50\ri
03/29/2010 08:57 AM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\activerecord-oracle_enhanced-adapter
-1.2.4\ri
03/26/2010 03:37 PM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\ruby-oci8-1.0.4-x86-mswin32\rdoc\cla
sses
03/29/2010 08:56 AM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\ruby-oci8-1.0.4-x86-mswin32\rdoc\cla
sses\DBI\DBD
03/29/2010 08:56 AM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\ruby-oci8-1.0.4-x86-mswin32\ri
03/29/2010 08:55 AM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\doc\ruby-oci8-1.0.4-x86-mswin32\ri\DBI\D
BD
03/29/2010 08:55 AM <DIR> OCI8
Directory of
C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-1.0.4-x86-mswin32\ext
03/29/2010 08:55 AM <DIR> oci8
Directory of C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-2.0.4\ext
03/26/2010 03:43 PM <DIR> oci8
Directory of C:\Ruby\lib\ruby\gems\1.8\gems\ruby-oci8-2.0.4\lib
03/26/2010 03:43 PM <DIR> oci8
Directory of C:\Ruby\lib\ruby\site_ruby\1.8
03/26/2010 04:44 PM <DIR> oci8
C:\Ruby>


In above list, C:\Ruby\extract is where I unloaded my zip files. I did
the

ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install


> You wrote 'gem install ruby-oci8 -v 1.0.4' but
> C:/Ruby/lib/ruby/site_ruby/1.8/oci8.rb is
> a part of ruby-oci8 2.0 because it requires oci8lib_18.
> I guess that you mix some ruby-oci8 versions and package types.

After the setup metioned above didn't work, I found a website that says
, just
do the gem install ruby-oci8 -v 1.0.4 (see
http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html)





--
Posted via http://www.ruby-forum.com/.