MySQL Install: ERROR: Failed to build gem native extension

前端 未结 14 1679
天涯浪人
天涯浪人 2020-11-28 19:23

I\'m trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command gem install mysql and

相关标签:
14条回答
  • 2020-11-28 20:00

    I had also forgotten to actually install MySQL in the first place. Following this guide helped a lot.

    http://www.djangoapp.com/blog/2011/07/24/installation-of-mysql-server-on-mac-os-x-lion/

    As well as adding these lines to my .profile:

    export PATH="/usr/local/mysql/bin:$PATH"
    alias mysql=/usr/local/mysql/bin/mysql
    alias mysqladmin=/usr/local/mysql/bin/mysqladmin
    
    0 讨论(0)
  • 2020-11-28 20:02

    if you are installing from source here is a tutorial.would be happy if it helps http://raihan90.blogspot.com/2009/03/mysql-step-by-step-hacking-into-mysql.html

    0 讨论(0)
  • 2020-11-28 20:04

    A number of people found this post helpful.

    Also, I needed to do first type this:

    yum install mysql-devel
    

    and then:

    gem install mysql 
    

    For some people you may need to type:

    gem install mysql -- --with-mysql-config=/usr/local/mysql/mysql_config
    
    0 讨论(0)
  • 2020-11-28 20:07
    yum -y install gcc mysql-devel ruby-devel rubygems
    gem install mysql2
    
    0 讨论(0)
  • 2020-11-28 20:13

    on OSX mountain Lion: If you have brew installed, then brew install mysql and follow the instructions on creating a test database with mysql on your machine. You don't have to go all the way through, I didn't need to After I did that I was able to bundle install and rake.

    0 讨论(0)
  • 2020-11-28 20:13

    In order to resolve

    Gem::Ext::BuildError: ERROR: Failed to build gem native extension error for mysql2,

    I think libmysql-ruby got changed with ruby-mysql

    Simply try with following commands,

    sudo apt-get install ruby-mysql

    & then

    sudo apt-get install libmysqlclient-dev
    
    0 讨论(0)
提交回复
热议问题