新手问题 bundle install 的时候怎么带上 --with-mysql-include 这样的参数

snjxiaojing · 2014年12月18日 · 最后由 snjxiaojing 回复于 2014年12月18日 · 2605 次阅读

正在手动安装 gitlab,git clone 源码到服务器上后进行bundle install操作,装 mysql2 这个 gem 的时候提示错误,google 得知要指定 lib 等的路径,于是有了以下命令:

gem install mysql2  -v '0.3.16' -- --with-mysql-include=/usr/local/mariadb/include/mysql/ --with-mysql-lib=/usr/local/mariadb/lib/ --with-mysql-dir=/usr/local/mariadb/

提示安装成功:

This could take a while...
Successfully installed mysql2-0.3.16
Parsing documentation for mysql2-0.3.16
Done installing documentation for mysql2 after 0 seconds
1 gem installed

然后我把 gem 的INSTALLATION DIRECTORY下mysql2-0.3.16目录拷贝到了项目所在的 gems 下,然后再bundle install想继续安装的时候还是提示安装 mysql2 报错,跟之前一样的错误。 然后想把 gem 安装时的参数也给 bundle,请问一下应该怎么做~~~ 先谢过了~~~

use this solve the error: sudo apt-get install libmysqlclient-dev

#1 楼 @huhongda 谢谢你,我找到我想要的方法了

$ bundle config build.mysql2 --with-mysql-include=/usr/local/mariadb/include/mysql/ --with-mysql-lib=/usr/local/mariadb/lib/ --with-mysql-dir=/usr/local/mariadb/
$ bundle install
需要 登录 后方可回复, 如果你还没有账号请 注册新账号