<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Digital Jacob</title>
	<atom:link href="http://digitaljacob.riff.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitaljacob.riff.dk</link>
	<description>The digital life of Jacob Riff</description>
	<lastBuildDate>Mon, 26 Oct 2009 22:19:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using ruby-odbc with unixODBC on Snow Leopard</title>
		<link>http://digitaljacob.riff.dk/2009/10/26/using-ruby-odbc-with-unixodbc-on-snow-leopard/</link>
		<comments>http://digitaljacob.riff.dk/2009/10/26/using-ruby-odbc-with-unixodbc-on-snow-leopard/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 21:44:31 +0000</pubDate>
		<dc:creator>jriff</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://digitaljacob.riff.dk/?p=9</guid>
		<description><![CDATA[I am trying to get my development environment up and running on Snow Leopard. I need to be able to connect to an SQL server through Ruby and Rails and that has been working fine on Leopard.
Snow Leopard being x86_64 presents a few problems. One of them was that I needed ruby-odbc to use my [...]]]></description>
			<content:encoded><![CDATA[<p>I am trying to get my development environment up and running on Snow Leopard. I need to be able to connect to an SQL server through Ruby and Rails and that has been working fine on Leopard.</p>
<p>Snow Leopard being x86_64 presents a few problems. One of them was that I needed ruby-odbc to use my installed unixODBC and not iodbc that ships with OSX. (<a title="Here" href="http://www.ruby-forum.com/topic/195920">Here</a> is why).</p>
<p>According to <a href="http://www.metaskills.net/2009/9/5/the-ultimate-os-x-snow-leopard-stack-for-rails-development-x86_64-macports-ruby-1-8-1-9-sql-server-more">this</a> guide it is advisable to use MacPorts to install an entire stack of ruby and everything else. I have a problem with this approach because it complicates things and because I like to use stock stuff whenever possible. Just a matter of taste.</p>
<p>I set out to try to make it work.</p>
<p>When following <a title="Here" href="http://www.ruby-forum.com/topic/195920">this</a> post I got everything to work except that ruby-odbc insisted on using iodbc and not unixODBC. After digging around I found out that when making unixODBC it (libodbc.dynlib) becomes x86_64 only.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 209px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Jacob-Riffs-MacBook:unixODBC-2.2.14 jacob$ file /usr/local/unixODBC-2.2.14/lib/libodbc.dylib</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 209px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/usr/local/unixODBC-2.2.14/lib/libodbc.dylib: Mach-O 64-bit dynamically linked shared library x86_64</div>
<pre>MacBook:unixODBC-2.2.14 jacob$ file /usr/local/unixODBC-2.2.14/lib/libodbc.dylib
/usr/local/unixODBC-2.2.14/lib/libodbc.dylib: Mach-O 64-bit dynamically linked shared library x86_64</pre>
<p>When ruby-odbc&#8217;s extconf does it&#8217;s run it will try to gcc to both i386 and x86_64 &#8211; that will fail for unixODBC but not for iodbc (which is a fat file for both architectures). This is why ruby-odbc will choose iodbc:</p>
<pre>"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/usr/local/unixODBC-2.2.14/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common   conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/local/unixODBC-2.2.14/lib -L. -arch i386 -arch x86_64     -liodbc  -lruby -lodbcinst -liodbc  -lpthread -ldl  "
ld: warning: in /usr/local/unixODBC-2.2.14/lib/libodbcinst.dylib, file is not of required architecture
Undefined symbols for architecture i386:
  "_SQLConfigDataSource", referenced from:
      _t in ccLjoIVs.o
ld: symbol(s) not found for architecture i386</pre>
<p>What I ended up doing was to modify the makefile that extconf creates and remove all references to the i386 architecture and changing LIBS from iodbc to odbc. Here is the lines to change:</p>
<pre>CFLAGS   =  -fno-common -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common $(cflags)
ldflags  = -L. -arch x86_64
LDSHARED = cc -arch x86_64 -pipe -bundle -undefined dynamic_lookup
LIBS = $(LIBRUBYARG_SHARED) -lodbcinst -lodbc  -lpthread -ldl</pre>
<p>After this just do a make, make install and go! It might not be pretty, but it works.</p>
<p>I wonder if the right thing to do is to compile unixODBC as a fat file for both architectures but I don&#8217;t know how to do it.</p>
<p>I hope this helps somebody.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitaljacob.riff.dk/2009/10/26/using-ruby-odbc-with-unixodbc-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>iPhone tethering turns off</title>
		<link>http://digitaljacob.riff.dk/2009/10/08/iphone-tethering-turns-off/</link>
		<comments>http://digitaljacob.riff.dk/2009/10/08/iphone-tethering-turns-off/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 20:28:45 +0000</pubDate>
		<dc:creator>jriff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://digitaljacob.riff.dk/?p=3</guid>
		<description><![CDATA[I have been using iPhone tethering with both 3 (Hi3G) and Telia in Denmark (luckily none of the danish telcos charge for that service). However, every time I am tethering and receive a call tethering stops. Nothing too weird about that except that when in 3G coverage, it should be possible to maintain a data [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_5" class="wp-caption alignright" style="width: 202px"><img class="size-full wp-image-5 " title="iPhone Internet Tethering configuration screen" src="http://digitaljacob.riff.dk/wp-content/uploads/2009/10/IMG_04491.PNG" alt="iPhone Internet Tethering configuration screen" width="192" height="288" /><p class="wp-caption-text">iPhone Internet Tethering configuration screen</p></div>
<p>I have been using iPhone tethering with both 3 (Hi3G) and Telia in Denmark (luckily none of the danish telcos charge for that service). However, every time I am tethering and receive a call tethering stops. Nothing too weird about that except that when in 3G coverage, it should be possible to maintain a data connection during a call. What IS weird is that the &#8220;Internet Tethering&#8221; preference turns from &#8220;On&#8221; to &#8220;Off&#8221;. This results in the inability to continue tethering when the call ends without going through Settings &gt; General &gt; Network &gt; Internet Tethering and turning it back on.</p>
<p>I really hope that this is a bug in the 3.1 firmware and that it will be fixed in a future release.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitaljacob.riff.dk/2009/10/08/iphone-tethering-turns-off/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
