Oracle-oci8.2.0

Discussion in 'Ruby' started by Vetrivel Vetrivel, Nov 30, 2009.

  1. Problem in oci8.2.0.1.gem
    I installed oci8 using gem1.8 command .

    Then i required that file using oci8.But I got the error .
    require 'oci8'


    LoadError:
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib.so:
    invalid ELF header -
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib.so
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib.so
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/lib/oci8.rb:20
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
    `gem_original_require'
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from (irb):3
    --
    Posted via http://www.ruby-forum.com/.
     
    Vetrivel Vetrivel, Nov 30, 2009
    #1
    1. Advertising

  2. Vetrivel Vetrivel

    Luis Lavena Guest

    On Nov 30, 8:08 am, Vetrivel Vetrivel <>
    wrote:
    > Problem in oci8.2.0.1.gem
    >         I installed oci8 using gem1.8 command .
    >
    > Then i required that file using oci8.But I got the error .
    >  require 'oci8'
    >
    > LoadError:
    > /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib .so:
    > invalid ELF header -
    > /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib .so
    >         from
    > /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/ext/oci8/oci8lib .so
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    >         from
    > /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.7-x86-mswin32-60/lib/oci8.rb:20
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
    > `gem_original_require'
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    >         from (irb):3
    > --


    You installed a Windows binary gem on a Linux operating system:

    "x86-mswin32-60" is the platform of the gem.

    Please check the project page of the gem and look for build
    instructions for Linux.

    http://ruby-oci8.rubyforge.org/en/

    --
    Luis Lavena
     
    Luis Lavena, Nov 30, 2009
    #2
    1. Advertising

  3. Luis Lavena wrote:
    > On Nov 30, 8:08�am, Vetrivel Vetrivel <>
    > wrote:
    >> � � � � from
    >> � � � � from (irb):3
    >> --

    >
    > You installed a Windows binary gem on a Linux operating system:
    >
    > "x86-mswin32-60" is the platform of the gem.
    >
    > Please check the project page of the gem and look for build
    > instructions for Linux.
    >
    > http://ruby-oci8.rubyforge.org/en/




    Thanks for your reply. But I have installed

    gem1.8 install ruby-oci8-1.0.6.gem
    Successfully installed ruby-oci8-1.0.6
    1 gem installed
    Installing ri documentation for ruby-oci8-1.0.6...
    Installing RDoc documentation for ruby-oci8-1.0.6...

    require 'oci8' . I got following errors .

    LoadError: /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so: invalid
    ELF header - /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so
    from /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/local/lib/site_ruby/1.8/oci8.rb:20
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
    `gem_original_require'
    from
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from (irb):2
    --
    Posted via http://www.ruby-forum.com/.
     
    Vetrivel Vetrivel, Nov 30, 2009
    #3
  4. Vetrivel Vetrivel

    Luis Lavena Guest

    On Nov 30, 10:43 am, Vetrivel Vetrivel <>
    wrote:
    > Luis Lavena wrote:
    > > On Nov 30, 8:08 am, Vetrivel Vetrivel <>
    > > wrote:
    > >> from
    > >> from (irb):3
    > >> --

    >
    > > You installed a Windows binary gem on a Linux operating system:

    >
    > > "x86-mswin32-60" is the platform of the gem.

    >
    > > Please check the project page of the gem and look for build
    > > instructions for Linux.

    >
    > >http://ruby-oci8.rubyforge.org/en/

    >
    > Thanks for your reply. But I have installed
    >
    > gem1.8 install ruby-oci8-1.0.6.gem
    > Successfully installed ruby-oci8-1.0.6
    > 1 gem installed
    > Installing ri documentation for ruby-oci8-1.0.6...
    > Installing RDoc documentation for ruby-oci8-1.0.6...
    >
    > require 'oci8' . I got following errors .
    >
    > LoadError: /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so: invalid
    > ELF header - /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so
    >         from /usr/local/lib/site_ruby/1.8/i486-linux/oci8lib.so
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    >         from /usr/local/lib/site_ruby/1.8/oci8.rb:20
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
    > `gem_original_require'
    >         from
    > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    >         from (irb):2


    Somehow you have a oci8lib.so inside your site_ruby, which indicates
    something got installed as extension inside your Ruby installation and
    not as a gem.

    Please check back any previous attempt of installation of OCI8 you
    tried in your system, or check your Linux distribution for a package
    OCI for Ruby, which could be interfering.

    Without more information about your environment, how you reached that
    point, what distro of linux, how you installed Ruby and so on, we
    can't help you.

    Help us help you.

    --
    Luis Lavena
     
    Luis Lavena, Nov 30, 2009
    #4
  5. Luis Lavena wrote:
    > On Nov 30, 10:43�am, Vetrivel Vetrivel <>
    > wrote:
    >>
    >> Installing ri documentation for ruby-oci8-1.0.6...
    >> � � � � from
    >> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
    >> `gem_original_require'
    >> � � � � from
    >> /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    >> � � � � from (irb):2

    >
    > Somehow you have a oci8lib.so inside your site_ruby, which indicates
    > something got installed as extension inside your Ruby installation and
    > not as a gem.
    >
    > Please check back any previous attempt of installation of OCI8 you
    > tried in your system, or check your Linux distribution for a package
    > OCI for Ruby, which could be interfering.
    >
    > Without more information about your environment, how you reached that
    > point, what distro of linux, how you installed Ruby and so on, we
    > can't help you.
    >
    > Help us help you.



    Thanks for your help ,

    I have written a simple program to connect with oracle . But
    I faced the below error . In this program i have mentioned the gem path
    So I am saying that , it is taking from the
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib path .

    The program

    $LOAD_PATH.unshift("/usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/")
    require 'oci8'
    $LOAD_PATH.unshift("/usr/lib/ruby/gems/1.8/gems/dbi-0.4.1/lib/")

    require 'dbi' ;
    dbd_dr = DBI::DBD.const_get:)OCI8)
    dbd_dr::Driver.new
    DBI.connect('dbi:OCI8:database_name:20.1.65.132:1521', 'username',
    'password')

    But I got following error

    env.c:257:in oci8lib.so: ORA-12154: TNS:could not resolve the connect
    identifier specified (DBI::DatabaseError)
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/oci8.rb:229:in
    `initialize'
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/dbd/OCI8.rb:182:in `new'
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/dbd/OCI8.rb:182:in
    `connect'
    from
    /usr/lib/ruby/gems/1.8/gems/dbi-0.4.1/lib/dbi/handles/driver.rb:33:in
    `connect'
    from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.1/lib/dbi.rb:143:in
    `connect'
    from test.rb:13

    Then I tried like this
    OCI8.new("username","password",'//ipaddress:port',:SYSDBA) ;

    But I got below error

    server.c:48:in oci8lib.so: ORA-12504: TNS:listener was not given the
    SERVICE_NAME in CONNECT_DATA (OCIError)
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/oci8.rb:219:in
    `initialize'
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/oci8.rb:142:in
    `do_ocicall'
    from
    /usr/lib/ruby/gems/1.8/gems/ruby-oci8-1.0.5/lib/oci8.rb:219:in
    `initialize'
    from test.rb:14:in `new'
    from test.rb:14

    I am using ruby1.8












    --
    Posted via http://www.ruby-forum.com/.
     
    Vetrivel Vetrivel, Dec 1, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    252
    Wilson Bilkovich
    Nov 7, 2006
  2. Jason  Vogel
    Replies:
    4
    Views:
    319
    Jason Vogel
    Nov 21, 2006
  3. Brian Candler
    Replies:
    1
    Views:
    201
    Brian Candler
    Mar 20, 2007
  4. Peter Bailey
    Replies:
    0
    Views:
    212
    Peter Bailey
    May 25, 2007
  5. Feyruz
    Replies:
    4
    Views:
    2,339
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page