Gem win2008 下安装 gem 问题 (无外网环境)

kitt · 2013年09月29日 · 最后由 1010101001110 回复于 2016年06月03日 · 2373 次阅读

情景如下,win2008 得到 64 位系统,没有外网,安装的是 ruby1.9.3,现在安装 mysql 的 gem 包,但是出现如下错误,求高手提示解答。什么换系统啊,别再 win 下搞开发啊,接网啊,百度啊这类的回答绕行。

C:\>gem install mysql-2.9.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql-2.9.1.gem:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-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
        --srcdir=.
        --curdir
        --ruby=C:/Ruby193/bin/ruby
        --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-libmysqllib
        --without-libmysqllib


Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql-2.9
.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/
gem_make.out

C:\>

probably lack of necessary libraries and/or headers.
缺少一些必要得库、头文件。。。 最简单得方法,连外网把环境搭好再转内网,我深受内外网隔离之苦

如果只是开发的话可以试试 sqlite,我已经好久不用 windows 了。

checking for main() in -llibmysql... no 说明没有 libmysql , 需要下载 mysql 的 dev 包

linux 下面: aptitude search libmysql | grep ruby

需要 登录 后方可回复, 如果你还没有账号请 注册新账号