OK... weird problem.
I have passenger running Rails 2.1 on FreeBSD. Works fantastic.
I access MS SQLServer from the FreeBSD box as a read only data source (all my real work is done in PostgreSQL)
If I fire up irb, this works:
> require 'rubygems'
> require 'dbi'
> DBI.connect('dbi:odbc:aoshanzo', 'user', 'password')
=> #<DBI::DatabaseHandle:0x......
All OK.
If I log into the FreeBSD box and open up a console, I can access the MS SQLServer based models fine.
$ ./script/console
>> RoPerson.find(:first)
=> #<RoPerson pers_id: 12222.....
I can even fire up webrick on the production server and hit it on port 3000 and it accesses the MSSQL Server models fine.
But when I try and do it through a controller action through a passenger instance, I get:
A DBI::InterfaceError occurred in reports#create:
Could not load driver (no such file to load - odbc)
/usr/local/lib/site_ruby/1.8/dbi.rb:344:in 'load_driver'
Now the only thing I can see is that the passenger instance is hitting the site_ruby copy of dbi instead of the gem. But how can I force it to use the gem version?
Putting config.gem dbi in the environment block doesn't seem to work.
Any ideas?
Mikel