Connection with a Firebird database

0

Good morning, my doubt arises because I can not find a gem or how to use a database of firebird 2.5 in ruby 2.3.0 and rails 5.0.0.1

I want to create an alternative connection since by default it used a mysql database, but I need to insert, update and compare data with the firebird DB that belongs to an existing system.

I thank you in advance for the support you can give me.

  

Annex error when I try to install Gem 'fb'

Fetching fb 0.8.0
Installing fb 0.8.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fb-0.8.0
/home/daniel/.rbenv/versions/2.3.0/bin/ruby -r
./siteconf20170902-2516-125u1ez.rb extconf.rb
checking for isc_attach_database() in -lfbclient... no
checking for isc_attach_database() in -lgds... no
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/fb-0.8.0/mkmf.log

current directory:
/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fb-0.8.0
make "DESTDIR=" clean

current directory:
/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fb-0.8.0
make "DESTDIR="
compiling fb.c
fb.c:41:19: fatal error: ibase.h: No existe el archivo o el directorio
 #include <ibase.h>
               ^
compilation terminated.
make: *** [fb.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/fb-0.8.0 for
inspection.
Results logged to
/home/daniel/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/fb-0.8.0/gem_make.out

An error occurred while installing fb (0.8.0), and Bundler cannot
continue.
Make sure that 'gem install fb -v '0.8.0'' succeeds before bundling.

In Gemfile:
  fb
    
asked by Daniel Romero 01.09.2017 в 20:46
source

1 answer

1

You can try the gem activerecord-fb-adapter , which works well with rails 4.x, but you'll have to test to see if it also works with rails 5.0.

In case the previous one does not work for you, you can use the gem fb 1 , through from which you can make direct connections to the DB without any type of ORM (that is, you would do the manual queries). The advantage of this gem is that it will work for you regardless of your version of rails.

1 The libfbclient.so library is not included in the version of firebird 2.5 , so it is necessary to install < strong> firebird-dev to be able to install the gem.

    
answered by 01.09.2017 / 22:16
source