小编Tha*_*yen的帖子

错误:安装mysql2时出错:错误:无法构建gem原生扩展

我在尝试为Rails安装gem install mysql2 -v'0.3.17'时遇到了一些问题.当我尝试通过运行gem install mysql2 -v'0.3.17'或gem install mysql2 -v'0.3.17'来安装它时,它给出了以下错误:

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


Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysql-config
    --without-mysql-config

Gem files will remain installed in `..../gems/ruby-1.9.3-p392/gems/mysql2-0.3.17 for inspection`.
Results logged to `.../gems/ruby-1.9.3-p392/extensions/x86_64-darwin-14/1.9.1/mysql2-0.3.17/gem_make.out`
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题并成功安装mysql2?

谢谢大家.

ruby mysql gem ruby-on-rails ruby-on-rails-3

10
推荐指数
3
解决办法
1万
查看次数

标签 统计

gem ×1

mysql ×1

ruby ×1

ruby-on-rails ×1

ruby-on-rails-3 ×1