Use MariaDB instead of MySQL in my Rails project

后端 未结 6 1325
春和景丽
春和景丽 2021-02-05 07:25

How can I use MariaDB instead of MySQL in my Rails project?

When I try to install mysql2 gem it returns error,because mysqlclient was not found.

Here some soluti

6条回答
  •  遇见更好的自我
    2021-02-05 07:41

    For recent ubuntu 15.04 vivid and Debian 8.0 Jessie:

    No need to install from a ppa (mariadb-server is included), but you have to install libmariadb-client-lgpl-dev and libmariadb-client-lgpl-dev-compat and configure the gem to use mariadb_config:

    apt-get install mariadb-server libmariadb-client-lgpl-dev libmariadb-client-lgpl-dev-compat
    
    gem install mysql2 -- --with-mysql-config=/usr/bin/mariadb_config
    
    # or for bundler
    bundle config build.mysql2 --with-mysql-config=/usr/bin/mariadb_config
    bundle install
    

提交回复
热议问题