Forum: Ruby on Rails ruby connect oracle problem

3218124dc039bf9afba426245deaaf13?d=identicon&s=25 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
(LoadError)*

my code is here.

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

Pls help me. What's wrong ?

Regards.
Dd5ad2ff6fe9fd92364528b599dc450e?d=identicon&s=25 Khizer Mehdi (Guest)
on 2013-08-29 10:39
(Received via mailing list)
Hi Tsolmon,

     Have u installed  ruby-oci8 gem package

Regards
Mehdi
3218124dc039bf9afba426245deaaf13?d=identicon&s=25 Tsolmon Narantsogt (Guest)
on 2013-08-29 10:48
(Received via mailing list)
Yes i installed ruby-oci8 from source.
like this
linux:
  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/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
/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 '
failed
Try 'ruby setup.rb --help' for detailed usage.
make: *** [config.save] Error 1

I got those lines.

Regards
Dd5ad2ff6fe9fd92364528b599dc450e?d=identicon&s=25 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

Regards
Mehdi
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.