Errors Installing mysql2 gem via the Bundler

前端 未结 9 641
庸人自扰
庸人自扰 2020-12-04 10:33

I am trying to install the mysql2 gem via the Bundler, but it keeps dying with the following error:

** executing command
/home/cc_rails/.rvm/rub         


        
相关标签:
9条回答
  • 2020-12-04 11:05

    The above problem will be occured because the mysql-devel package is not properly installed in your system. I will be explain the same in Centos of how to fix it. When you try to install that package using,

        yum install mysql-devel
    

    somtimes there will be some clash occurs with the existing packages that gets installed if you install the MySql-Administrative tool and MySQL query browser.

    In that case, you need to uninstall all the existing mysql2 packages and install it again.

        rpm -qa -last | grep -i mysql
        yum remove MySQL-server-5.5.27-1.rhel5
        yum remove MySQL-client-5.5.27-1.rhel5
        yum remove mysql-gui-tools-5.0r12-1rhel4
        yum remove mysql-query-browser-5.0r12-1rhel4-a
    

    So, you can uninstall whatever mysql things displayed with rpm -qa as like above.

    Then you can install the mysql-server and mysql-client.

        yum install mysql-server
        yum install mysql-client
    

    Now you do the installation of mysql-devel package.

        yum install mysql-devel
    

    Now there is no package clashes and you can able to install the mysql2 gem.

        gem install mysql2 -v '0.3.11'
    

    Now your mysql2 gem will be successfully installed and you are good to go.

    0 讨论(0)
  • 2020-12-04 11:09

    For Ubuntu have to install following. libmysqlclient-dev libmysqlclient16

    0 讨论(0)
  • 2020-12-04 11:12

    I ran into this issue while bundle installing for redmine on fedora 23. The solution I found was to issue this command - sudo dnf install redhat-rpm-config.

    Not only did this fix my issue with installing mysql2, but also for nokogiri and redcarpet.

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