[Nitro] OG and DBI: Oxyliquit draft tip

Jonathan Buch john at oxyliquit.de
Sat Sep 1 05:47:38 EDT 2007


Hi,

> To use DBI there is some work that needs to be done to install the
> drivers.  I thought to make a Oxyliquit tip about this - I'd
> appreciate feedback on the script below.

that sounds nice.  ^_^

> The draft below prepares for sqlite, mysql and odbc.
> It'd be useful to know if it is possible to change DBNAME (used twice)
> to install postgres , Oracle, any other drivers?

See at end of script, that would be my idea.

> Before placing anything on Oxyliquit it would be useful to confirm
> which distributions the following 'script' succeeds on - the location
> of the odbc library might be an issue if it is not in /usr/lib....
> other issues?
> I've tested the following on openSUSE 10.2

That looks like it'd work everywhere where ruby is installed (and
that stuff compiles that is).
I'm surprised though that it's so hard to install that stuff...  Arent
there gems for dbi?

> My understanding is that DBI and ruby-ODBC are packaged in windows
> one-click installer - can some one confirm that?


> #-- start-bash ----------------------------
> su
> ODBCVER=0.9995
> DBIVER=0.1.1
> pushd /tmp
> wget http://ch-werner.de/rubyodbc/ruby-odbc-${ODBCVER}.tar.gz
> tar -xvf ruby-odbc-${ODBCVER}.tar.gz
> pushd ruby-odbc-${ODBCVER}
> ruby extconf.rb --enable-dlopen
> make
> make install
> #Installation of utf8 version:
> ruby -Cutf8 extconf.rb --enable-dlopen
> make -C utf8
> make -C utf8 install
> popd
>


gem install "$@" sqlite
wget http://rubyforge.org/frs/download.php/12368/dbi-${DBIVER}.tar.gz
tar -xvf dbi-${DBIVER}.tar.gz
pushd ruby-dbi

str='dbi,dbd_sqlite,dbd_odbc'
for db in $@; do
   str="$str,dbd_$db";
done

echo $str

ruby setup.rb config --with="$str"
ruby setup.rb install
popd
popd
> #-- end-bash ----------------------------

./bash-script psql oracle

-------

Just lumped together, but that might just work.  :)

Where of course the 'gem install' for postgres would be ruby-postgres,
and that would not compatible with the "--with="... maybe you have a
better idea looking at this.  Make people install the gems manually?
Or..  make the script ruby which then could be better adapted, my bash
scripting foo is like non-existant.  ;)

Jo

-- 
Feel the love
http://pinkjuice.com/pics/ruby.png


More information about the Nitro-general mailing list