[英]Installing mysql2 0.4.10 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension
I have installed rbenv to use ruby 2.2.4 version我已经安装了 rbenv 来使用 ruby 2.2.4 版本
when I run the command bundle install
当我运行命令
bundle install
I get this我明白了
Why it is为什么会这样
current directory: /Library/Ruby/Gems/2.6.0/gems/mysql2-0.4.10/ext/mysql2
as, I am using ruby 2.2.4因为,我正在使用 ruby 2.2.4
is this the reason to failed to build gem native extensions?这是未能构建 gem 原生扩展的原因吗?
if, how I can fix this path?.如果,我该如何修复这条路径?
I came across this error while running bundle for mysql2 (0.5.2)我在为 mysql2 (0.5.2) 运行 bundle 时遇到了这个错误
Running these commands worked for me.运行这些命令对我有用。
brew install openssl
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
bundle
You can refer to this link for further help https://github.com/brianmario/mysql2/issues/1005您可以参考此链接获取更多帮助https://github.com/brianmario/mysql2/issues/1005
bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib"
without the cppflags
part solve the problem.没有
cppflags
部分解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.