Recently I’ve been trying to get my new unibody macbook pro connecting to SQL Server 2005 with FreeTDS. I was following the great guide from Ken Collins, author of the rails-sqlserver activerecord adapter that I use but no matter what configuration settings I edited I couldn’t get my machine to connect to the SQL Server.
When checking the event viewer on the Windows Server 2k8 box I received the following error:
1 2 3
I was pretty sure it had to do with my locale because if that was incorrect it would make sense that the packets might be structurally invalid. My locale was set to
en_US.us-ascii the default setting apparently after a clean OS X Snow Leopard install. The problem was that I couldn’t figure out how to change it. Then I ran across this archived post and I was able to temporarily change my locale by typing:
I was able to verify my locale settings by typing
locale in a terminal window which yielded the following:
1 2 3 4 5 6 7 8
The problem is if I opened a new terminal window my locale was back to the default ascii junk. To make this change permanent I simply had to edit my ~/.profile and add the export statement that we set earlier to the bottom of the file.
Now when I open a new window and type
locale it says
en_US.UTF-8 for everything. At this point I was able to continue following Ken’s guide for testing the TSQL commands and getting ruby-dbi and everything else wired up.