Skip to content

no such file to load -- oci8lib_191 #24

Closed
suhrawardi opened this Issue Nov 27, 2012 · 9 comments

2 participants

@suhrawardi

Hi,

On our production machines, the lib/oci8lib_192.so is generated, and not a lib/oci8lib_191.so
Because of that, we have to modify the so_basename, so that the correct *.so file is required.

# The suffix number indicates the ruby API version.

# 18 - ruby 1.8.x

# 191 - ruby 1.9.1 and 1.9.2

# 19x - ruby 1.9.x future version which will break the API compatibility

case RUBY_VERSION

when /^1.9.1/

so_basename += '191'

when /^1.9.2/

so_basename += '192'

when /^1.8/

so_basename += '18'

else

raise 'unsupported ruby version: ' + RUBY_VERSION

end

require so_basename

Otherwise we get the following error:

no such file to load -- oci8lib_191

On our development machines, the generated file is indeed lib/oci8lib_191.co
What would be the best way to patch ruby-oci8 to solve this issue for once and for all (environments)?

Btw, Our development server is a:
Linux name-dev 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011 i686 i686 i386 GNU/Linux

and production is a:
Linux name-prod 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux

and we use RVM.

Thanks,
Jarra

@kubo
Owner
kubo commented Nov 28, 2012

What distribution is used for the production machines?
What version of ruby (including patch level) do you use?

As far as I know, the output of the following code is '1.9.1' for all rubies from 1.9.1 to 1.9.3.

ruby -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']"
@suhrawardi

Hi,

I see now that we do not use RVM btw, but this are the Ruby details:

$ ruby -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']"
1.9.2
$ ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
$ cat /proc/version
Linux version 2.6.32-5-amd64 (Debian 2.6.32-45) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Sun May 6 04:00:17 UTC 2012
$ uname -a
Linux name 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux

As you can see, the output of ruby -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']" is 1.9.2 in our case...

So, that means that the following fix should solve it in all cases?
http://www.myhack58.com/Article/html/3/8/2012/33024.htm

Thx, Jarra

@kubo
Owner
kubo commented Nov 28, 2012

Could you post the distribution version, not the linux kernel version?
I thought that the distribution is Debian 6.0.5 because its kernel version is 2.6.32-45.
But the ruby version in Debian 6.0 looks 1.9.2-p0.
I thought it might be Debian unstable. But the ruby version looks 1.9.3-p194.

So, that means that the following fix should solve it in all cases?
http://www.myhack58.com/Article/html/3/8/2012/33024.htm

No. The following ruby was compiled from source code distributed by ruby-lang.org.

$ ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
$  ruby -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']"
1.9.1
@suhrawardi

Hi Kubo,

Thanks for your prompt reply.

The Debian version is:
$ cat /etc/issue
Debian GNU/Linux 6.0 \n \l

$ cat /etc/debian_version
6.0.5

But after digging a bit deeper, I found out that on our production server, Ruby is indeed compiled from source as well...
So that might explain the problem. But is there any way to solve this issue?

Thanx,
Jarra

@kubo
Owner
kubo commented Dec 2, 2012

IMO, your ruby was compiled with a configure option '--with-ruby-version=1.9.2'.
The options changes RbConfig::CONFIG['ruby_version'].

Your issue will be solved by changing lib/oci8.rb as follows but I won't apply it to my code.

From:

  case RUBY_VERSION
  when /^2\.0/
    so_basename += '200'
  when /^1\.9/
    so_basename += '191'
  when /^1\.8/
    so_basename += '18'
  else
    raise 'unsupported ruby version: ' + RUBY_VERSION
  end

To:

  require 'rbconfig' if not defined? RbConfig
  so_basename += RbConfig::CONFIG['ruby_version'].gsub(/\W/, '')
@kubo kubo added a commit that referenced this issue Dec 16, 2012
@kubo Use RUBY_VERSION instead of RbConfig::CONFIG['ruby_version'] to know …
…the ruby ABI version.

The latter may be changed by the configure option --with-ruby-version.
(github issue #24 reported by suhrawardi)
63d22a7
@kubo
Owner
kubo commented Dec 16, 2012

I have fixed the issue by 63d22a7.
It uses RUBY_VERSION instead of RbConfig::CONFIG['ruby_version'] in ext/oci8/extconf.rb
because the latter may be changed by the configure option --with-ruby-version.

Suhrawardi, could you post the output of the following command to ensure that
your ruby was configured with --with-ruby-version?

ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']"
@kubo kubo closed this Dec 16, 2012
@suhrawardi

Hey Kubo,

Here is the output:

$ ruby -rrbconfig -e "puts RbConfig::CONFIG['configure_args']"
'--prefix=/usr' '--program-suffix=1.9.2' '--with-ruby-version=1.9.2'
$ ruby -rrbconfig -e "puts RbConfig::CONFIG['ruby_version']"
1.9.2
$ ruby -e "puts RUBY_VERSION"
1.9.2

As you can see, both RUBY_VERSION and RbConfig::CONFIG['ruby_version'] both return 1.9.2.
But as it is consistent in both files now, I think this should solve our problem...

Thanks a lot,
Jarra

@kubo
Owner
kubo commented Dec 17, 2012

Thank you.

I'm now sure the fix is correct.

@suhrawardi

Kubo, thank you very much for your help!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.