Firebird News

Monday, May 19, 2014

Fire Ruby - howto start with Firebird and Ruby on Ubuntu / Debian

This howto is about installing firebird ruby driver on Ubuntu or any Debian based distro
you might need some firebird dependencies and if you need the stable Firebird server  Firebird 2.5 guide to install it

The very basic firebird package to build only the driver is firebird2.5-dev

sudo apt-get install firebird2.5-dev git-core
and choose yes when asked
Then you need to install ruby and the recommended rails way is to use rbenv 

rbenv install 2.1.2
rbenv global 2.1.2
ruby -v
Best way is to install it from gem

gem install fb

Alternate way  is to build install our gem (latest build-able is located here )

git clone https://github.com/rowland/fb.git
cd fb/
gem build fb.gemspec


You will get something like this in terminal :
 Successfully built RubyGem
  Name: fb
  Version: 0.*.*
  File: fb-0.*.*.gem


Now is time to install it using the gem command

gem install fb-0.*.*.gem



Please read the README.
here is how i tested on my machine

Here is part of the example i ran on my pc

pico test.rb 


And here are the results for my ruby test
ruby test.rb 
ID: 0, Name: John 0
ID: 9, Name: John 9

What is next class ? RoR on Firebird

8 comments:

Vikram Kumar Mishra said...

No firebird connection established

I am getting above error while trying to connect my rails app with firebird.

I have followed your post and in my gemfile i have added

gem 'activerecord-fb-adapter'
gem 'fb'

my rails version is 3.2.6 and ruby version is 1.9.2.

Also i have cloned 'fb' and 'fb_adapter' in rails app root directory.

Please help me.

Adrian Marius Popa said...

Try the 0.7.0 version from gem
also i have updated the repository git instructions please use the new one because there are updates for rails 3.2.x

http://rubygems.org/gems/activerecord-fb-adapter

Adrian Marius Popa said...

See this issue Try adding "create: true" under your profile in database.yml.

https://github.com/rowland/activerecord-fb-adapter/issues/1#issuecomment-6608210

Adrian Marius Popa said...

Oh a i see that you have solved that issue and hit another one :)

Vikram Kumar Mishra said...

yes, can you suggest me something on the issue posted on github regarding execute method.

Adrian Marius Popa said...

it is solved in a fork , i will send a pull in the master today

https://github.com/Ziaw/activerecord-fb-adapter/commit/82099e7403aa6c69e543f63f79b5d97e253966af

Adrian Marius Popa said...

Also i have added another arel rails 4 update to the pull request

https://github.com/rowland/activerecord-fb-adapter/pull/13

Paul Mollomo said...

Great blog Mariuz; you use many languages including Free Pascal. What's your favorite and why preference for Firebird over MySQL?