{"id":1832,"date":"2009-03-28T15:19:55","date_gmt":"2009-03-28T15:19:55","guid":{"rendered":"http:\/\/justthesam.com\/2009\/03\/install-mysql-gem-on-ruby-191-on-mac-os-x\/"},"modified":"2009-03-28T15:19:55","modified_gmt":"2009-03-28T15:19:55","slug":"install-mysql-gem-on-ruby-191-on-mac-os-x","status":"publish","type":"post","link":"https:\/\/justthesam.com\/?p=1832","title":{"rendered":"Install mysql gem on Ruby 1.9.1 on Mac OS X"},"content":{"rendered":"<p>I&#39;ve been experimenting with Ruby 1.9.1 and trying to make it my natural home recently. Crucial to that was getting the mysql gem installed. Actually it&#39;s fairly straightforward with the 2.8.1 version of the gem and only very minor mods to the official instructions at&#0160;<a href=\"http:\/\/www.tmtm.org\/en\/mysql\/ruby\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.tmtm.org\/en\/mysql\/ruby\/<\/a> were required.<\/p>\n<p><\/p>\n<div>Note that I have only tried this to work against MySQL 5.0.x, which I have installed in \/usr\/local\/mysql, as all my previous attempts to use MySQL 5.1 have failed miserably and I&#39;ve given up on that for now. These instructions install from source, resulting in a fresh&#0160;\/usr\/local\/ruby191\/lib\/ruby\/site_ruby\/1.9.1\/mysql.bundle. Then you can simply require &#39;mysql&#39; in your Ruby code and you&#39;re away.<\/div>\n<p><\/p>\n<div>\n<div>\n<ul>\n<li>Downloaded 2.8.1 source tgz from RubyForge, linked from <a href=\"http:\/\/www.tmtm.org\/en\/mysql\/ruby\" target=\"_blank\" rel=\"noopener\">http:\/\/www.tmtm.org\/en\/mysql\/ruby<\/a>\/ downloads section.<\/li>\n<li>Expanded the tgz with Finder, then opened a command prompt&#8230;<\/li>\n<li>&gt; cd mysql-ruby-2.8.1<\/li>\n<li>&gt; ruby extconf.rb &#8211;with-mysql-config=\/usr\/local\/mysql\/bin\/mysql_config -with-mysql-dir=\/usr\/local\/mysql<\/li>\n<li>&gt; make<\/li>\n<li>&gt; sudo make install<\/li>\n<\/ul>\n<\/div>\n<div>Et voila! Note that make did output a bunch of warnings about implicit 64\/32 bit conversion that suggests the code isn&#39;t entirely 64 bit happy, but I&#39;ve not observed any problems as a result. Yet.<\/div>\n<p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;ve been experimenting with Ruby 1.9.1 and trying to make it my natural home recently. Crucial to that was getting the mysql gem installed. Actually it&#39;s fairly straightforward with the 2.8.1 version of the gem and only very minor mods to the official instructions at&#0160;http:\/\/www.tmtm.org\/en\/mysql\/ruby\/ were required. Note that I have only tried this to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,22,23,33],"tags":[],"class_list":["post-1832","post","type-post","status-publish","format-standard","hentry","category-mac","category-programming","category-ruby","category-webtech"],"_links":{"self":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts\/1832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1832"}],"version-history":[{"count":0,"href":"https:\/\/justthesam.com\/index.php?rest_route=\/wp\/v2\/posts\/1832\/revisions"}],"wp:attachment":[{"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justthesam.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}