免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4778 | 回复: 3
打印 上一主题 下一主题

如何安装sqlite3.gem [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-11-13 18:07 |只看该作者 |倒序浏览
window平台,安装这个gem出现问题,谷歌了很多方法都解决不了。
安装这个gem出现问题,已安装sqlite3.
C:\Ruby192>gem install sqlite3-1.3.4.gem --local
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-1.3.4.gem:
  ERROR: Failed to build gem native extension.

  C:/Ruby192/bin/ruby.exe extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Install SQLite3 from http://www.sqlite.org/ first.
*** 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:/Ruby192/bin/ruby
  --with-sqlite3-dir
  --without-sqlite3-dir
  --with-sqlite3-include
  --without-sqlite3-include=${sqlite3-dir}/include
  --with-sqlite3-lib
  --without-sqlite3-lib=${sqlite3-dir}/lib
  --enable-local
  --disable-local


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1
.3.4 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.4/ext/sqlite3/
gem_make.out

论坛徽章:
0
2 [报告]
发表于 2011-11-14 17:08 |只看该作者
下载 http://www.sqlite.org/download.html

的那三个文件
http://www.sqlite.org/sqlite-shell-win32-x86-3070900.zip
http://www.sqlite.org/sqlite-dll-win32-x86-3070900.zip


解压, 并复制文件
    * sqlite3.exe
    * sqlite3.def
    * sqlite3.dll
到你的ruby安装文件夹下, 假设是 c:\ruby\bin 或 (c:\windows\system32)


然后安装
    gem install sqlite3-X.X.X.gem --local

   

如果这个安装有选项, 看情况选, 一般是第一项。


安装是否成功, 进入ruby的irb, 打 require 'sqlite3' 返回 true刚成功

论坛徽章:
0
3 [报告]
发表于 2011-11-14 17:26 |只看该作者
“gem install sqlite3-1.3.4.gem --local”这里是相同的错误。
“进入ruby的irb”是lib目录吧,如下:
C:\Ruby192\lib>require 'sqlite3'
'require' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

btw,没想到你也到这里混,我csdn那位

论坛徽章:
0
4 [报告]
发表于 2011-11-14 17:50 |只看该作者
“gem install sqlite3-1.3.4.gem --local”这里是相同的错误。
“进入ruby的irb”是lib目录吧,如下:
C ...
blackhat591 发表于 2011-11-14 17:26



    irb 是一个ruby自带的命令, 不是进入lib文件夹

  1. $ irb
  2. irb(main):001:0> require 'sqlite3'
  3. => true
  4. irb(main):002:0>
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP