<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Eschew Obfuscation: Installing MySQL Ruby Gem on Mac OS X 10.4</title>
    <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Max Dunn's Personal Blog</description>
    <item>
      <title>Installing MySQL Ruby Gem on Mac OS X 10.4</title>
      <description>&lt;p&gt;There are some problems installing the Ruby Gem MySQL on the Mac 10.4. When you do a:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;sudo gem install mysql&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;you will likely get an error like:&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;To fix this problem, run this:&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;(Solution From &lt;a href="http://wiki.rubyonrails.com/rails/pages/HowtoInstallOnOSXTiger#7"&gt;How to Install on &lt;span class="caps"&gt;OSX&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;Next, you will probably see this error:&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
mysql.c: In function 'Init_mysql':
mysql.c:2015: error: 'ulong' undeclared (first use in this function)
...
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;To fix this, change to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 and  edit &amp;#8220;mysql.c&amp;#8221; to add this to the top:&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
#define ulong unsigned long
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;(Solution from: &lt;a href="http://www.railtie.net/articles/2006/09/12/running-rails-on-os-x-with-mysql-5-0-24"&gt;I.NFECTIO.US&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;Now recompile with:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;sudo make
sudo make install
sudo make clean&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;That should do it!&lt;/p&gt;</description>
      <pubDate>Tue, 12 Dec 2006 23:14:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:39ce37c7-30bf-445e-baf4-433574dc28f8</guid>
      <author>Max Dunn</author>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4</link>
      <category>Ruby on Rails</category>
      <category>Tech Tips</category>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by smo</title>
      <description>&lt;p&gt;Thanks a bunch, mate!&lt;/p&gt;</description>
      <pubDate>Sun, 01 Jun 2008 02:44:01 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:5efe9e84-17ce-47b3-8995-24912cf75599</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-606</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by Roger Pack</title>
      <description>&lt;p&gt;Thank you much!  Worked, but since I had installed mysql via MacPorts, the gem command was
ruby extconf.rb&amp;#8212;with-mysql-config=/opt/local/bin/mysql_config5&lt;/p&gt;


	&lt;p&gt;Thanks.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Mar 2008 20:21:11 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:af611e17-d9ab-44a2-bbaf-490c022ed3f9</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-544</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by papyromancer</title>
      <description>&lt;p&gt;I finally got this working with some help from your blog, and over this way&amp;#8212;&amp;gt;
&lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249986" rel="nofollow"&gt;http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/249986&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 17 Nov 2007 09:48:44 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:98918f73-157b-4827-8c8c-6b2a34c90a9d</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-376</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by Max Dunn</title>
      <description>&lt;p&gt;You should be in the same directory as the mysql.c file. It sounds like your installation wasn&amp;#8217;t complete since it was missing this file. You could try searching for it using &amp;#8220;locate mysql.c&amp;#8221; and if not found, then reinstall the mysql gem.&lt;/p&gt;</description>
      <pubDate>Thu, 11 Oct 2007 14:39:14 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:b4a080d8-297f-4c7b-8644-9298d4c8f63a</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-347</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by jsf</title>
      <description>&lt;p&gt;where should I be when typing the &amp;#8216;sudo make&amp;#8217;, &amp;#8216;sudo make install&amp;#8217; and the &amp;#8216;sudo make clean&amp;#8217; above?&lt;/p&gt;


	&lt;p&gt;Also,  i had to look in this dir:&lt;/p&gt;


	&lt;p&gt;/opt/local/lib/ruby/gems/1.8/gems/mysql-2.7&lt;/p&gt;


	&lt;p&gt;to try your solution.&lt;/p&gt;


	&lt;p&gt;There was no mysql.c but there was a mysql.c.in file&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Am I hopelessly lost or what?&lt;/p&gt;</description>
      <pubDate>Thu, 11 Oct 2007 13:59:32 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:315da921-5fe8-4d85-85ea-f6b7467055f1</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-346</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by Denny</title>
      <description>&lt;p&gt;#define ulong unsigned long&lt;/p&gt;


	&lt;p&gt;Thank you thank you thank you  :)&lt;/p&gt;</description>
      <pubDate>Wed, 07 Mar 2007 04:14:23 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:b140edee-3b80-4a13-97a9-a3dc74fe16fc</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-211</link>
    </item>
    <item>
      <title>"Installing MySQL Ruby Gem on Mac OS X 10.4" by Lorin Rivers</title>
      <description>&lt;p&gt;Thanks!&lt;/p&gt;


	&lt;p&gt;I wish the gem method worked, but hey&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Thu, 18 Jan 2007 14:41:46 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:f740b41d-a5a3-4347-8c0c-93e9c64c4e5e</guid>
      <link>http://blog.maxdunn.com/articles/2006/12/12/installing-mysql-gem-on-mac-os-x-10-4#comment-206</link>
    </item>
  </channel>
</rss>
