Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Informix 7.20 on BSD with Ruby 1.9 #5

Open
map7 opened this issue Jul 7, 2022 · 1 comment
Open

Informix 7.20 on BSD with Ruby 1.9 #5

map7 opened this issue Jul 7, 2022 · 1 comment
Assignees

Comments

@map7
Copy link

map7 commented Jul 7, 2022

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
Copy link
Owner

santana commented Apr 8, 2023

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

@santana santana self-assigned this Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants