首页 > 数据库技术 > 详细

ruby on rails mysql2 error

时间:2015-12-22 19:42:19      阅读:249      评论:0      收藏:0      [点我收藏+]

Q: 

    am having some problems when trying to install mysql2 gem for Rails. When I try to install it by running bundle install or gem install mysql2 it gives me the following error:

Error installing mysql2: ERROR: Failed to build gem native extension.

How can I fix this and successfully install mysql2?



A:

    

On Ubuntu/Debian and other distributions using aptitude:

sudo apt-get install libmysql-ruby libmysqlclient-dev

If the above command doesn‘t work because libmysql-ruby cannot be found, the following should be sufficient:

sudo apt-get install libmysqlclient-dev

On Red Hat/CentOS and other distributions using yum:

sudo yum install mysql-devel

On Mac OS X with Homebrew:

brew install mysql

   


本文出自 “哀伤的风格” 博客,请务必保留此出处http://1822557.blog.51cto.com/1812557/1727205

ruby on rails mysql2 error

原文:http://1822557.blog.51cto.com/1812557/1727205

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!