MySql, Ruby and Snow Leopard (yet another post)

umlaut_couch
The blogosphere is full of a lot of posts about this particular problem, but I thought I’d chime in with my own insights. This is evidenced by two errors. First, whenever you try to do any kind of rake db task:

rake aborted!
uninitialized constant MysqlCompat::MysqlRes

Second, you cannot install the Mysql Gem. missing libraries, or other errors, didn’t save them when I got them! Sorry.

Solution Part 1: Know Your Computer
I have an old MacBook2,1 with 64-bit core 2 duo processor. That means, it’s “x86_64″ architecture. It is not “i386″. It took me a while to convince myself of this. I looked up under the Apple at the MacBook’s “about this Mac,” I read the Wiipedia site on the Mac series- FYI all kindsa nerdy details at the Model Specifications section.

Solution Part 2: Re-Install MySql & Gem
I finally got Ruby on Rails to register my MySql installed 64-bit software by doing the following:

  1. Check if there’s any running instances of MySQL
    > ps -ef | grep mysql
  2. Kill them if you find them:
    > sudo kill [insert pid]
  3. Delete the old MySql directories (if you have the Startup, go there and delete those. I didn’t.)
    >cd /usr/local
    >sudo rm mysql*
  4. Uninstall Ruby’s MySql gem.
    >sudo gem uninstall mysql
  5. I rebooted here. Not technically necessary, but it was advised somewhere, so I did it, and I think it’s a good idea.
  6. Download and install the MySql *for your architecture*.Mine is (x86_64)… dev.mysql.com/downloads/mysql.
  7. Install the gem with associated flags:
    >sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/include

    Note: remove the new line endings, it should all be on one line.

  8. Get the MySql server running –
    > cd /usr/local/mysql > sudo ./bin/mysqld_safe (Enter your password, if necessary) (Press Control-Z) > bg (Press Control-D or enter "exit" to exit the shell)
  9. To test, go back and run that rake task.

Troubleshooting

  • If you get an error about hash class detection, that’s an issue with 32-bit running on a 64-bit architecture. The 32-bit MySql and 32-bit ruby gem won’t basically work despite both being compatible with each other. This is in the library of gem data connection classes.
  • If you can’t compile the gem, that’s due to it not being able to find the classes in your MySQL installation- that’s why we’re sending it all of the paths in the command line gem build.
  • Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) (Mysql::Error)

    that error is due to MySql server not running as a process on your Mac. So do that- instructions are above.

  • Did you like the gratuitous photo of my cat? Makes these tech posts more interesting!

    More Reading
    Ruby forum from 11/2009

    StackOverflow on the same issue
    More explanation re: archtypes on TechLiberty blog

108 Comments »

  1. Comment by transfer to ipod

    Posted on April 5, 2010 at 6:57 pm

    Actually I,ve encountered this problem before. And thanks for posting this blog. Now I can try this my own.. Thanks a again!

  2. Comment by pressurized walls

    Posted on April 12, 2010 at 9:05 pm

    Thanks for posting this blog. It helps me debug my programs.

  3. Comment by custom papers

    Posted on April 13, 2010 at 5:47 am

    Hi i got a 32-bit MySql and 32-bit ruby gem but it doesn't work. How can i resolve this one.

  4. Comment by rediska

    Posted on April 19, 2010 at 7:11 am

    It's look like this site

  5. Comment by seo company

    Posted on April 28, 2010 at 7:33 pm

    I read the Wiipedia site on the Mac series- FYI all kinda nerdy details at the Model. Is that true?

  6. Comment by ny escorts

    Posted on May 5, 2010 at 7:48 pm

    good debugger! thank you.

  7. Comment by plcarter84

    Posted on June 17, 2010 at 6:38 pm

    I found this a bit too late. :( I really needed it few days ago. But now it will be in my list.

  8. Comment by sample essay

    Posted on July 5, 2010 at 8:11 am

    thanks for sharing what you have learned. I would definitely bookmark your site. Finally, i found the site that I will be needing the future.

  9. Comment by Uninstall Program

    Posted on July 8, 2010 at 10:28 am

    Your article is really helpful:)

  10. Comment by medyum

    Posted on July 30, 2010 at 10:12 am

    Actually I've encountered this problem before. And thanks for posting this blog. Now I can try this my own.. Thanks a again!

  11. Comment by refurbished laptops

    Posted on August 11, 2010 at 11:41 pm

    Hi i got a 32-bit MySql and 32-bit ruby gem but it doesn't work. How can i resolve this one

  12. Comment by iphone headphones

    Posted on August 11, 2010 at 11:41 pm

    Thanks for posting this blog. It helps me debug my programs.

  13. Comment by wowgold

    Posted on August 12, 2010 at 4:01 am

    Nice post, helped me a lot.

  14. Comment by Cape Coral Real Estate

    Posted on August 12, 2010 at 4:12 am

    Googeling for that very same problem, you post saved me some precious time to fix it. Thanks.

  15. Comment by ipad accessories

    Posted on August 12, 2010 at 4:34 am

    mysql is such a pain for me, thx for the tips.

  16. Comment by VONDACUNNINGHAM100

    Posted on August 12, 2010 at 7:29 am

    Thanks for sharing with us. It is very valuable for me. I visit this site first time. I would definitely bookmark this site. Keep up the good work.

  17. Comment by Amazon Search

    Posted on August 12, 2010 at 7:49 am

    Always nice to read this useful info, m8, thnx for the tip. I've worked some with Ruby, but didn't get far due to PHP job I have. Still, great share, bookmarked!

  18. Comment by Igre za odrasle

    Posted on August 12, 2010 at 7:49 am

    Great share, bookmarked! MySQL can be tricky to install sometimes.

  19. Comment by Igre za odrasle

    Posted on August 12, 2010 at 7:50 am

    Great tips!! I've worked with ruby just a bit, seems powerful language. Rep+

  20. Comment by male multiple orgasm

    Posted on August 12, 2010 at 8:50 am

    very well information you write it very clean. Im very lucky to get this information from you.

  21. Comment by registry cleaners freeware

    Posted on August 12, 2010 at 8:51 am

    Nice article. Thank you for this info

  22. Comment by mafia wars guide

    Posted on August 12, 2010 at 8:54 am

    wonderful share, great article, very useful for me…thanks

  23. Comment by Lithuania

    Posted on August 12, 2010 at 8:56 am

    Very interesting. I'm completely terrible at any SQL stuff myself, luckily this will turn me into a professional overnight.

  24. Comment by make rap beats

    Posted on August 12, 2010 at 9:01 am

    Nice post and very helpful

  25. Comment by K_hosny_A

    Posted on August 12, 2010 at 9:26 am

    aflamonline.net
    aflam-3araby.com

  26. Comment by Aflam

    Posted on August 12, 2010 at 9:29 am

    aflamonline.net
    aflam-3araby.com

  27. Comment by Wheretodonateyourcar

    Posted on August 12, 2010 at 9:51 am

    great information here

  28. Comment by Info

    Posted on August 12, 2010 at 10:16 am

    Number 7 helped me ALOT, thank you so much!

  29. Comment by Japanese AV Idols

    Posted on August 12, 2010 at 12:04 pm

    Awesome tips, thanks!

  30. Comment by Dallas moving labor

    Posted on August 12, 2010 at 12:51 pm

    Great job. Keep up the good work.

  31. Comment by betran

    Posted on August 12, 2010 at 1:33 pm

    MySQL makes my head hurt.

  32. Comment by Webmaster Forum

    Posted on August 12, 2010 at 1:35 pm

    Thanks.

  33. Comment by Buy amoxicillin online

    Posted on August 12, 2010 at 1:38 pm

    i love this stuff

  34. Comment by User3306

    Posted on August 12, 2010 at 1:40 pm

    I've had the same issues (errors) before. Thanks for presenting an answer.

  35. Comment by John

    Posted on August 12, 2010 at 1:59 pm

    Ah Mysql is such a pain for me too, i had problems in my DB on the web site i was making and i fixed problem witch was in mysql … Now everything works, Thanks for tips
    Free Wallpapers

  36. Comment by Webmaster

    Posted on August 12, 2010 at 1:59 pm

    Great tips, thanks. Keep it coming.

  37. Comment by Large wall clocks

    Posted on August 12, 2010 at 2:06 pm

    awesome. I always had trouble with that! Thanks heaps!

  38. Comment by Buy Cialis Professional

    Posted on August 12, 2010 at 2:20 pm

    great blog

  39. Comment by Lakrati Radouane

    Posted on August 12, 2010 at 3:49 pm

    http://www.homedepotcoupons.org/

  40. Comment by Living Room Furniture

    Posted on August 12, 2010 at 4:03 pm

    Oh yes that too cool of you.

  41. Comment by centrum handlowe

    Posted on August 12, 2010 at 4:07 pm

    hello banane,

    “MySql, Ruby and Snow Leopard (yet another post)”

    Great picture of cut and wodnerful information I found here.

    thx

  42. Comment by Hostessy

    Posted on August 12, 2010 at 4:12 pm

    very well information you write it very clean. Im very lucky to get this information from you.

  43. Comment by Hostessy

    Posted on August 12, 2010 at 4:13 pm

    very well information you write it very clean. Im very lucky to get this information from you.

  44. Comment by Hostessy

    Posted on August 12, 2010 at 4:14 pm

    Awesome. I always had trouble with that! Thanks heaps!

  45. Comment by Websytedev

    Posted on August 12, 2010 at 6:59 pm

    http://www.bestofarchive.com

  46. Comment by Websytedev

    Posted on August 12, 2010 at 6:59 pm

    http://www.dumpscollection.com

  47. Comment by Info

    Posted on August 12, 2010 at 7:20 pm

    Awesome tips, been looking for someone knowledgable to deliver this.

  48. Comment by Free samples without surveys

    Posted on August 12, 2010 at 8:15 pm

    great post..ill share it on facebook

  49. Comment by smonty

    Posted on August 13, 2010 at 1:23 am

    SQL is a horror story for me. I totally don't understand it at all. Thanks for the post. Helps with understanding it a little. Thanks. Home Audio Electronics

  50. Comment by Top Comedy Movies

    Posted on August 13, 2010 at 4:59 am

    Ditto! Good post!

  51. Comment by Past Life Reading

    Posted on August 13, 2010 at 5:05 am

    Thank you so much for the code. I was helping so much troubling with it!

  52. Comment by Watch Anime Online

    Posted on August 13, 2010 at 5:06 am

    Do You know if these command work for Centos Linux as well?

  53. Comment by watch anime online

    Posted on August 13, 2010 at 5:07 am

    Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) (Mysql::Error)

    I got that error but somehow it works after I restart my mysql server.

  54. Comment by Carrie Thomson

    Posted on August 13, 2010 at 7:54 am

    It seems really not a easy problem, thanks for this post.

  55. Comment by montana fishburne sextape

    Posted on August 13, 2010 at 11:10 am

    Great post, keep up the good work

  56. Comment by Remote Access Software

    Posted on August 13, 2010 at 6:29 pm

    Isn't that overcomplicating it a bit with MySQL?

  57. Comment by почистване

    Posted on August 13, 2010 at 8:20 pm

    Good post,thanks and good luck!

  58. Comment by Bad Breath

    Posted on August 14, 2010 at 12:22 am

    I was thinking the same thing. Why go to all the bother!?

    (Time to ditch the Mac too, btw; they're sooo 2005! :-) :-)

  59. Comment by Forex Trading Systems

    Posted on August 14, 2010 at 3:07 pm

    SQL is eating up my brain since a long time. Thanks for the tips to fix some problems with it.

  60. Comment by Tony Tran

    Posted on August 15, 2010 at 11:44 am

    There are something must be unique like this.

  61. Comment by vaibhav

    Posted on August 15, 2010 at 11:47 pm

    Good post,thanks

  62. Comment by Gift Card guru

    Posted on August 16, 2010 at 2:06 pm

    Nice post , some time we confused because of database problem in my site:
    http://www.topfreegiftcards.com and
    http://www.freeoffernews.com

  63. Comment by Programa Gratis

    Posted on August 17, 2010 at 5:37 pm

    Very nice and informative post, clearly explaining everything about the theme and customization options of the website
    information like this are very useful on the Internet
    Nice information, I really appreciate the way you presented.Thanks for sharing..

  64. Comment by free proxy site

    Posted on August 23, 2010 at 2:39 pm

    How I can setup MySql as a process???

  65. Comment by mypadmedia

    Posted on August 23, 2010 at 3:37 pm

    Cute kitty :D

  66. Comment by ap04

    Posted on August 24, 2010 at 9:11 am

    Nice Post, that is great information, thanks for share.
    Dofollow blog / site and super backlinks, please visits to :

    http://www.renewmyenergy.com.au (Solar Panels)

    http://www.fidashop.co.cc (Grosir Sepatu Futsal)

    http://www.lusihan.com (Grosir Aksesoris Wanita)

    http://www.kimmyhan.net (Pakaian Wanita)

  67. Comment by the best cookware

    Posted on August 26, 2010 at 5:19 pm

    I can't seem to get the MySQL to acquire the ruby data, can you help me? Thanks

  68. Comment by Jim smith

    Posted on September 3, 2010 at 11:07 pm

    I have had the same problem before. I just had to redo my whole computer to solve it.

  69. Comment by Apple Roof Cleaning

    Posted on September 16, 2010 at 8:01 pm

    This is a common problem, thanks for posting this!

  70. Comment by Wow cataclysm

    Posted on September 20, 2010 at 9:27 am

    Thanks for the help ran into this and found this as the first result in google

  71. Comment by G-Shock Watches

    Posted on September 20, 2010 at 9:30 am

    Interesting problem thanks for the solution

  72. Comment by sayasatria

    Posted on September 23, 2010 at 7:05 am

    I find everywhere, And God thanks I found the solution here.
    Thanks guy for creating this articles.

  73. Comment by aufche

    Posted on September 27, 2010 at 7:02 am

    the cat is cute…

    http://jogjabelanjaphone.com

  74. Comment by sex toys

    Posted on October 1, 2010 at 3:33 am

    This helped heaps!! thank you!

  75. Comment by Matthew Ma

    Posted on October 1, 2010 at 9:41 pm

    This is a common problem, thanks for posting this!

  76. Comment by Buy Online Steroids

    Posted on October 2, 2010 at 11:59 am

    Its really very common problem… Nice article on that for sure..

  77. Comment by THE

    Posted on October 10, 2010 at 10:04 am

    http://www.adultvideochatsex.com/ online dating

  78. Comment by Unlock iPhone

    Posted on October 13, 2010 at 3:33 pm

    glad u solve it

  79. Comment by Nathan Saputra

    Posted on November 3, 2010 at 6:13 am

    welcome to :
    http://www.angsport.co.cc (Pusat Sepatu Futsal)
    http://www.nathansaputra.com (Seo Services)
    http://www.renewmyenergy.com.au (Solar Panels)
    http://www.yuli-shop.blogspot.com (Grosir Tas Wanita)

  80. Comment by Learn with Susmita

    Posted on November 17, 2010 at 11:13 am

    Thanks for the great info

  81. Comment by mytermpaperspace

    Posted on November 22, 2010 at 12:01 pm

    The MySql, Ruby and Snow Leopard is one of the amazing animals that we have I think that the information about both is really good to read and it gives the knowledge of both of them.

  82. Comment by advantagepapers

    Posted on December 1, 2010 at 6:31 am

    The MySql, Ruby and Snow Leopard has come a lots of time I think that this is a good information but the thing which come regularly do lost it command.

    Research Papers
    http://www.advantagepapers.com/

  83. Comment by Raj Sa

    Posted on December 16, 2010 at 4:37 am

    Thanks for the nice information; it is really awesome and very useful for the blogger reader those want to know about the topic. Thanks for sharing the nice information with us. commercial cleaning chicago

  84. Comment by Semih Bilir

    Posted on February 25, 2011 at 10:33 pm

    thank you.

  85. Comment by Apollo

    Posted on March 21, 2011 at 1:02 pm

    The cat looks cute!

    Tenant Screening

  86. Comment by trevor75

    Posted on May 9, 2011 at 6:24 pm

    Thanks. That’s great info for a newbie like me. I even like how you
    segmented your blog clearly… I’m still trying to get mine that focused. I
    guess it’s all a work in progress.
    Type your comment here.write my essay

  87. Comment by Online CNA Classes

    Posted on May 18, 2011 at 7:10 am

    this is a great post related for mysql ruby and snow leopard yet another post

  88. Comment by Online CNA Classes

    Posted on May 18, 2011 at 7:11 am

    Cool post. Very interesting and fascinatingly. Excellent. Thank You guys for your good job. Funny SMS | Love SMS

  89. Comment by Online CNA Classes

    Posted on May 18, 2011 at 7:12 am

    Fantastic post, I really look forward to updates from you..
    CNA Classes Hawaii | CNA Classes Texas |

  90. Comment by Online CNA Classes

    Posted on May 18, 2011 at 7:18 am

    Great post!! Keep up the good work – I'm sure someday soon, someone will be doing an Ada Lovelace post about you. Online CNA Classes | CNA Classes Online

  91. Comment by Noman Ikhlaq

    Posted on May 20, 2011 at 11:39 am

    Your blog is really excellent. It inspires the readers who has that great desire to lead a better and happier life. Thanks for sharing this information and hope to read more from you.

     Regards!
    fun fun fun
    jobs jobs jobs

  92. Comment by Online CNA Classes

    Posted on May 23, 2011 at 10:54 am

    Thanks a million for writing this article!! I was having a hard time
    determining what to put in my critique and how to arrange them. You made
    it so much easier! Thank you thank you thank you!!

  93. Comment by filme online gratis

    Posted on June 2, 2011 at 10:19 pm

    I was having a hard time
    determining what to put in my critique

  94. Comment by Iolani Aaliyah

    Posted on June 3, 2011 at 11:28 am

    I’m really amazed by this blog. Tons of useful posts and info on here. Thumbs up, thanks a lot. CNA Job Description   and CNA Practice Test

  95. Comment by student loan

    Posted on June 7, 2011 at 5:29 am

    Yet another MYSQL great post..

  96. Comment by free google sms

    Posted on June 19, 2011 at 10:01 am

    i love this post : mysql ruby and snow leopard yet another pos
    best seo services,
    seo resources,
    funny sms

  97. Comment by Phong

    Posted on June 22, 2011 at 1:49 pm

    I type only >ps -ef
    ok?

  98. Comment by SEO Services

    Posted on June 25, 2011 at 9:38 am

    Awesome website! Your style is so fresh in comparison with most other people. Thanks for posting whenever you have the opportunity to, I will be sure to save your website!s. Visit – SEO Sydney
    SEO

  99. Comment by shanhassan

    Posted on July 4, 2011 at 9:42 am

    auto glass repair in baltimore md

    Nice article some useful information shared thanks.

    auto glass repair in baltimore md

  100. Comment by shanhassan

    Posted on July 4, 2011 at 9:43 am

    Pak Forums , free download movies

    http://prizbonds.com

    I have found this blog a very great resource for me and some of my friends

      Pak forums , free download movies

  101. Comment by Charlie

    Posted on July 13, 2011 at 10:46 am

    Hi i got a 32-bit MySql and 32-bit ruby gem but it doesn't work. How can i resolve this one. Biltricide

  102. Comment by thongchai

    Posted on September 15, 2011 at 6:23 pm

    looking for xbox 306 controller xbox306

  103. Comment by sigit hermawan

    Posted on April 29, 2012 at 12:57 pm

    nice post…

  104. Comment by Marry Jones

    Posted on July 5, 2012 at 11:47 am

     

    I was very pleased to find this site.I wanted to thank you
    for this great blogI definitely enjoying every little bit of it and I have you
    bookmarked to check out new stuff you post.

    business plan
    writer

  105. Comment by Salma Seo

    Posted on October 4, 2012 at 5:16 am

    Lowest cost official contract mobile phone deals UK. Free gifts & offers on Nokia, Samsung, Sony Ericsson, Blackberry, HTC, LG, Apple & Motorola smart-phones range.

     
     

  106. Comment by jak volni

    Posted on November 26, 2012 at 9:48 am

    Best online shopping
    store for products like luxury bed linen, bedding at bedbathlinen com au. We have got the largest range of
    products with every product having superior quality of its own and discounted
    prices now browse the best bedding for you.

  107. Comment by Karun Worradee

    Posted on January 10, 2013 at 6:31 am

    Thanks for this information.

  108. Comment by CeoLamChanToan

    Posted on August 26, 2014 at 8:01 am

    Thanks for the nice information; it is really awesome and very useful
    for the blogger reader those want to know about the topic. Thanks for
    sharing the nice information with us.
    may loc nuoc, máy lọc nước
    http://maylocnuocpretech.com/

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>