santana / ruby-informix

Ruby library for IBM Informix
http://ruby-informix.rubyforge.org
Other
17 stars 7 forks source link

Informix 7.20 on BSD with Ruby 1.9 #5

Open map7 opened 2 years ago

map7 commented 2 years ago

I've got an old Informix 7.20 legacy accounting application in which I would like to interact with from ruby.

I installed your gem which complained about a missing informix.c file;

$ gem install ruby-informix
Building native extensions.  This could take a while...
Successfully installed ruby-informix-0.7.2
1 gem installed
Installing ri documentation for ruby-informix-0.7.2...
file 'ext/informixc.c' not found
Building YARD (yri) index for ruby-informix-0.7.2...
Installing RDoc documentation for ruby-informix-0.7.2...
file 'ext/informixc.c' not found

Regardless of this I pushed on and created a file

#!/usr/bin/env ruby
require 'rubygems'
require 'informix'

db = Informix.connect('mydb')

But when I run it I get the following error;

/home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- informixc (LoadError)
    from /home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/ruby-informix-0.7.2/lib/informix.rb:30:in `<top (required)>'
    from /home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /home/map7/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from ./test_informix.rb:3:in `<main>'
santana commented 1 year ago

Hi @map7 !

The problem is that the gem needs the ext/informixc.c file to work, which is generated from ext/informixc.ec, and for some reason it fails to generate it and yet it succeeds installing the gem.

Try building the gem locally yourself. Make sure you have your INFORMIXDIR environment variable set correctly and run:

rake gem

That command includes this command to generate the missing file:

$INFORMIXDIR/bin/esql -e informixc.ec