Unable to install mysql2 gem OS X Mountain Lion

后端 未结 3 2041
悲&欢浪女
悲&欢浪女 2020-12-19 08:45

I\'m new with RoR and I\'m trying to install Mysql2 -v \'0.3.11\'. I have OS X Mountain Lion, rails 3.2.6 ,ruby 1.9.3.

Below is the error I get. I looked everywher

相关标签:
3条回答
  • 2020-12-19 09:04

    As Deefour said, I had to use RVM. Answer goes to him, I just couldn't comment on his answer. +1

    But rvm exec bundle install gave me an error:

    rvm do bundle install was removed, use rvm 1.9.2,1.9.3 do bundle install or rvm all do bundle install instead.

    I used sudo rvm all do bundle install and it all went flawlessly from then on.

    0 讨论(0)
  • 2020-12-19 09:12

    You're using RVM instead of the Ruby that comes with 10.8. Good. Now, stop using the MySQL that comes with 10.8.

    Install and update Homebrew. Now run

    brew install mysql
    

    Use the /Gemfile in your project to install the mysql2 gem. Add

    gem "mysql2"
    

    to your /Gemfile. Then update your application with Bundler by running

    bundle install
    

    Let the package managers (Homebrew and Bundler) work for you.

    This should fix the issues you're having.

    0 讨论(0)
  • 2020-12-19 09:24

    I too get same type of error in mac10.10 and used below commands that work for me:

    1. Install and upgrade Homebrew using:

      brew install mysql

    2. run Install Mysql gem file using:

      gem install mysql2 -v '0.3.11'

    3. Run bundle install

    0 讨论(0)
提交回复
热议问题