Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:49:23+00:00 2026-05-25T00:49:23+00:00

I have been trying to get my dev environment setup on OS X for

  • 0

I have been trying to get my dev environment setup on OS X for a couple of days now, and I have had a lot of trouble with mysql. I have installed mysql via the dmg file available from the mysql website. This fixed most of the trouble I was having.

My current problem is that, when I run “rake db:migrate” I get the following error:

rake aborted!
undefined method `init’ for Mysql:Class

I read somewhere that using gem ‘mysql2’ in the Gemfile and mysql2 as the database adapter might fix the problem. I tried doing this, but it did not work. One thing to note is that mysql is not anywhere in my PATH variable, so typing ‘mysql’ in the terminal takes me to /var/_mysql which is kind of weird.

Do I need to add ‘/usr/local/mysql/bin’ to my path variable? If so, how do I do this in OS X?

Thanks.

EDIT: I added /usr/local/mysql/bin to my path, still have the same error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:49:23+00:00Added an answer on May 25, 2026 at 12:49 am

    To fix the problem I ended up using the mysql2 gem instead of the mysql gem. This process was not straight forward at all, so I wanted to post the exact steps I took in case someone needs help later.

    First, download the OS X DMG file that corresponds to your version of OS X from the mysql website. You will need to install mysql, then the startup item, and finally the preferences panel (All 3 of these were in the DMG file).

    Next, you need to add mysql to your path variable. I believe you can edit /etc/paths or add a new file to /etc/paths.rd/, but I ended up modifying my terminal’s configuration file. I added the following line to ~/.zshrc (This is only for zsh, if you use bash the file is something like ~/.bashrc):

    export PATH=[path:variables]:/usr/local/mysql/bin
    export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/"
    

    [path:variables] is just a place holder for all of the other path variables that were there. The second line is something that was required to get the mysql2 gem working. The second line allows mysql to find a required library file.

    Next, replace or add

    gem 'mysql' 
    

    with

    gem 'mysql2', '< 0.3'
    

    The < 0.3 was required, otherwise some weird errors were thrown. (Sorry, I didn’t save the stack trace). The final step is to change your database adapters to mysql2. I hope this can help someone save a great deal of headache 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to days now to get this website completed ... however,
I have been trying to get around this error for a day now and
I have been trying for 4 days to get app-engine and grails working together
I have been trying to get Google Chrome (6.0.401.1 dev) on Mac OS X
I have been trying to get more in to TDD. Currently keeping it simple
I have been trying to get yui-css grid system to make a three column
I have been trying to get nServiceBus to work with Ninject 2.0 as the
I have been trying to get LastBootUpTime using Win32_OperatingSystem class (WMI). HRESULT hr =
I have been trying to get this one section of my UI to immediatly
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.