Forum: Ruby on Rails ruby connect oracle problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tsolmon Narantsogt (Guest)
on 2013-08-29 10:26
(Received via mailing list)
Hello folks.

I'm new in Ruby also ROR.
I installed oracle intant client and test it it works fine. Now I wanna
connect to oracle db. But its got some error. like this
*custom_require.rb:36:in `require': cannot load such file -- oci8

my code is here.

require 'oci8'
oci ='user','pass','ip:port/sid')
oci.exec('select * from table') do |record|
  puts record.join(',')

Pls help me. What's wrong ?

Khizer Mehdi (Guest)
on 2013-08-29 10:39
(Received via mailing list)
Hi Tsolmon,

     Have u installed  ruby-oci8 gem package

Tsolmon Narantsogt (Guest)
on 2013-08-29 10:48
(Received via mailing list)
Yes i installed ruby-oci8 from source.
like this
  ruby setup.rb config -- --with-instant-client
  *then *

*mnts26@mnts26:~/Downloads/ROR OCI8/ruby-oci8-2.0.4$ make*
ruby -w setup.rb config
setup.rb:278: warning: assigned but unused variable - vname
setup.rb:278: warning: assigned but unused variable - desc
setup.rb:278: warning: assigned but unused variable - default2
setup.rb:109: Use RbConfig instead of obsolete and deprecated Config.
---> lib
---> lib/dbd
<--- lib/dbd
---> lib/oci8
<--- lib/oci8
<--- lib
---> ext
---> ext/oci8
/home/mnts26/Downloads/ROR OCI8/ruby-oci8-2.0.4/ext/oci8/extconf.rb
setup.rb:476: warning: Insecure world writable dir /opt/oracle in PATH,
mode 040777
/home/mnts26/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or
directory -- /home/mnts26/Downloads/ROR (LoadError)
'system /home/mnts26/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
/home/mnts26/Downloads/ROR OCI8/ruby-oci8-2.0.4/ext/oci8/extconf.rb '
Try 'ruby setup.rb --help' for detailed usage.
make: *** [] Error 1

I got those lines.

Khizer Mehdi (Guest)
on 2013-08-29 11:32
(Received via mailing list)
Installation failed due to error

For installing that ruby-oci8 gem  u need
1. instantclient-basic
2. instantclient-sdk
3. u need to export LD_LIBRARY_PATH  of that path
4. then run bundle install

This topic is locked and can not be replied to.