Hugh –

 

Again, I really appreciate your help.

 

I did install iodbc using the dmg package from the iodbc downloads page

 

I am trying a different track. I want to ensure that iODBC is working properly before worrying about ruby-odbc.

 

I used the OpenLink ODBC Adminstrator to set up  a driver referencing FreeTDS.

 

This is my freetds.conf file

[MACBOOKPRO_MSSQL]

host = 172.16.27.140

instance = MACBOOKPRO

tds version = 8.0

 

 I then added a DSN that references the FreeTDS driver.

 

This created an entry in my odbc.ini file in /Library/ODBC/

 

It looks like this

[ODBC Data Sources]

IAN_DEV = FreeTDS

 

[IAN_DEV]

Driver     = /usr/local/lib/libtdsodbc.so

Database   = ian_dev

Servername = MACBOOKPRO_MSSQL

Trace      = No

 

I noticed that my odbcinst.ini file is empty, so it is not clear to me where the driver information set up in the ODBC Admin tool is being stored. Should it be empty?

 

Using the ODBC Manager, I selected the dsn, and clicked the Test button, entered a username and password, and was told the “specified driver could not be loaded”. I clicked OK and was told:

Dlopen(/usr/ocal/lib/libtdsodbc.so, 6): no suitable image found. Did Find: /user/local/lib/libtdsodbc.so: mack-o, but wrong architecture

 

When I try to test using the command line tool iodbctest, it lists the dsn with the FreeTDS driver, but I get the following error:

1: SQLDriverConnect = [iODBC][Driver Manager]dlopen(/usr/local/lib/libtdsodbc.so, 6): Symbol not found: _CreateDataSource

  Referenced from: /usr/lib/libiodbcinst.2.dylib

  Expected in: flat namespace

 (0) SQLSTATE=00000

2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003

 

This is surprising, as I am not sure why the iodbctest tool is using the older version of the dylib.

 

Would you be willing to provide any insights into what might be happening, and why I cannot get iODBC to work.

 

I was thinking I should uninstall iodbc entirely, then reinstall it from the dmg package. Does this make sense? If so, how would I go about ensuring that all iODBC references were uninstalled?

 

Is there something else I should try?

 

Any advice is greatly appreciated. I am now at a complete loss, having spent the better part of 3 days trying to get this to work.

 

Best,
Tom

 

From: Hugh Williams [mailto:hwilliams@openlinksw.com]
Sent: Wednesday, August 18, 2010 1:32 PM
To: Tom Hoen
Cc: iodbc-macosx@lists.sourceforge.net
Subject: Re: [Iodbc-macosx] lazy symbol binding failed: Symbol not found: _Init_iODBC error. Any help would be greatly appreciated

 

Hi Tom,

 

I note the symbol not found error you report still references /usr/lib/libiodbc2.dylib, which is the location of the Apple bundle iODBC Driver Manager, alhtough you indicated having downloaded the latest iODBC from the web site,  by which I presume you mean http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads#Mac%20OS%20X ? As these updated installers from OpenLink Software do not install the iODBC Driver Manager in the same location as Apples, but rather /usr/local/iODBC (as is the norm on Unix systems) which is a symlink from the Framework based libraries we provide for Mac OS X:

 

 

$ ls -ltr /usr/local/iODBC/lib

total 16

lrwxr-xr-x  1 root  wheel  50 11 Aug 01:07 libiodbcinst.dylib -> //Library/Frameworks/iODBCinst.framework/iODBCinst

lrwxr-xr-x  1 root  wheel  42 11 Aug 01:07 libiodbc.dylib -> //Library/Frameworks/iODBC.framework/iODBC

 

So your build script should be referencing the iODBC libraries from either of these locations to use the latest iODBC Driver Manager, as detailed at:

 

            http://wikis.openlinksw.com/dataspace/owiki/wiki/UdaWikiWeb/MacOSXiODBC

 

I hope this helps ...

 

Best Regards

Hugh Williams

Professional Services

OpenLink Software

Twitter: http://twitter.com/OpenLink

 

On 17 Aug 2010, at 22:36, Tom Hoen wrote:



I am working on a Rails application that has to connect to a MSSQL database. I am developing the application on a Mac running Snow Leopard.

 

I have set up freetds and successfully connected to the database using tsql.

 

I have set up my odbc.ini and odbcinst.ini according to the most recent documentation.

 

However, when the Rails app attempts to connect to the database, I get the following error:

dyld: lazy symbol binding failed: Symbol not found: _Init_iODBC

  Referenced from: /usr/lib/libiodbc.2.dylib

  Expected in: flat namespace

 

dyld: Symbol not found: _Init_iODBC

  Referenced from: /usr/lib/libiodbc.2.dylib

  Expected in: flat namespace

 

I have installed the most recent version of iODBC from the site, and I have installed the OSX patch (I get the same error with the patch installed and prior to installing the patch).

 

I have also tried several different installs of ruby-odbc, thinking that this is related, but I get the same results.

 

Any ideas you may on how I can fix this or further trouble shoot would be greatly appreciated.

 

Tom

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev _______________________________________________
Iodbc-macosx mailing list
Iodbc-macosx@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iodbc-macosx

 

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.851 / Virus Database: 271.1.1/3077 - Release Date: 08/17/10 02:35:00