New support for Rails 2.1

Support for Rails 2.1 has been added to the latest version of the ibm_db gem (0.9.5). To install this version run gem install ibm_db on Windows. On Linux run the following:

$ . /home/db2inst1/db2profile
$ export IBM_DB_DIR=/opt/ibm/db2/V9.5
$ export IBM_DB_LIB=/opt/ibm/db2/V9.5/lib32
$ sudo gem install ibm_db

Adjust these commands for your paths, shell and architecture (e.g. 32 vs. 64 bits).

Please note that at this stage we don’t recommend that you download the outdated Starter Toolkit for DB2 on Rails. Instead, please grab and install DB2 Express-C, install Ruby through the One-Click Installer, install Rails through gems (gem install rails) and then proceed to install the ibm_db gem as explained above. When you install DB2, ensure to select the “Base application development tools” as illustrated here.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Posted by Antonio Cangiano | June 26 2008 05:40 pm | Announcements and How-to

4 Responses to “New support for Rails 2.1”

  1. blahzay on 02 Jul 2008 at 9:34 am #

    I’m new to DB2 so a few things are confusing me at the moment. So I’ve gotten DB2 and Rails playing nice together for the most part. However, one of the things that is confusing me is that Rails throws the error:

    Failed to connect to the [railsapp] due to: [IBM][CLI

    Driver] unless I issue the command:

    . /home/db2inst1/sqllib/db2profile

    using the same console that I start up webbrick.

    I realize this command is setting up the environment for DB2 to run in. This is may only be but a minor inconvenience while developing. However how do I get my app to run without throwing the error in a production environment. I’m used to just being able to install mysql and forget about it and it seems like DB2 requires a lot more hand holding to function properly. What am I missing?

  2. howardb on 16 Aug 2008 at 1:24 pm #

    DB2 permits the creation of numerous database engines, called ‘Database Managers’ (or INSTANCE), on the same server.

    Each engine is completely independent to enable these operational characteristics:
    - each runs under a different ‘owner’ account — in your example this is db2inst1
    - each can be started and stopped independently or else be a non-running ‘client’ instance
    - each can be managed independently and have independent administration groups
    - each can be a separate version or patch level or run a different edition of the product
    - each can manage one or more different databases and/or catalog a different set of remote database environments

    The db2profile script located under ~INSTANCE/sqllib/db2profile sets up all the environment variables (e.g. PATH, DB2INSTANCE, etc.) in order to access that particular INSTANCE.

    You must use this script to ‘choose’ the instance that your runtime environment will use.

    To avoid the inconvenience, since you only have one instance, you could add the one-line entry into your shell startup profile, or insert this into the script used to start your webserver.

    I hope this helps. howardb

  3. Nick on 14 Sep 2008 at 4:45 pm #

    Those of you who use the command ‘apt-get install db2exc’ to install the latest version of DB2 Express-C 9.5 (’db2exc-9.5.0-2′) on Ubuntu will need to manually remove the broken header file links found in the /usr/include directory, and run ‘db2ln’ (found in the /cfg directory) to re-create the header links.

  4. Matteo on 29 Sep 2008 at 8:59 am #

    I can use ibm_db also to connect to db2 on a iSeries server? And I can specify alsoa default library?

    Thanks

Trackback URI | Comments RSS

Leave a Reply