I can't run “bundle update” because of “mysql2” gem

后端 未结 5 1701
庸人自扰
庸人自扰 2021-02-14 14:29

I have this in the Gemfile:

gem \'mysql2\'

But when I run bundle update, I get this error message:

An error oc         


        
5条回答
  •  我在风中等你
    2021-02-14 14:54

    Looks like there is no mysql2 gem installed in your machine.As you are using Mac OSX,you should be installing mysql2 gem like this

    gem install mysql2 -- --with-mysql-dir=/usr/local/opt/mysql/ 
    

    If the above command did't work,try like this

    sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    

    And after try

    bundle install
    

    This should fix the error.

    Source

提交回复
热议问题