代码之家  ›  专栏  ›  技术社区  ›  Apoorv Saxena

sqlite3安装中的问题

  •  2
  • Apoorv Saxena  · 技术社区  · 16 年前

    出现以下错误:

    C:\gem>gem install sqlite3-ruby --local
    Building native extensions.  This could take a while...
    ERROR:  Error installing sqlite3-ruby:
            ERROR: Failed to build gem native extension.
    
    C:/Ruby/bin/ruby.exe extconf.rb
    checking for #include <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
            --srcdir=.
            --curdir
            --ruby=C:/Ruby/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
    
    
    Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1
    .3.0 for inspection.
    Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.0/ext/sqlite3/
    gem_make.out
    

    我已经复制了ruby/bin文件夹中所需的所有文件,但它仍然不断报告sqlite3.h丢失了这个错误。

    当我在本地安装gem时,请务必告诉我必须将sqlite3.h放在哪里,如您所见,我目前正在使用sqlite3的1.3.0版本进行安装。 我已经尝试过针对类似问题发布的解决方案。我使用的是Windows XP。

    事先谢谢。

    4 回复  |  直到 10 年前
        1
  •  3
  •   AlexC    15 年前

    我有这个问题。这就是我找到的解决方案。它不是很漂亮,但对我很有用。在我的案例中,我使用的是Cygwin。可能有一种类似的方法不用Cygwin来完成,但我不知道怎么做。

    1)下载 来源 SQLite的。我选择了sqlite 3.6.23,有点随意,通过这个网址: http://www.sqlite.org/src/info/4ae453ea7b 如果不起作用,请转到发布时间表 http://www.sqlite.org/src/timeline?n=200&t=release&y=ci ,选择一个版本,并下载它的zip文件。

    2)将zip存档文件解包到某个地方。去cygwin的那个目录。执行以下命令:

    /配置
    制作
    生成sqlite3.dll
    制作安装

    3)从目录中复制sqlite3.exe和sqlite3.dll make 在你的道路上创造了它们。

    4)完成后, gem install sqlite3-ruby 终于工作了。

    我在遵循这个指南: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/240902

        2
  •  2
  •   Zombo tliff    10 年前

    我知道这已经关闭了一段时间了,但我也有同样的问题 帮助。安装APT CYG。首先通过标准安装Subversion和WGET Cygwin设置程序。然后运行以下命令:

    wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
    install apt-cyg /bin
    

    现在使用apt cyg安装sqlite3开发:

    apt-cyg install libsqlite3-devel
    

    最后

    $ gem install sqlite3-ruby
    Building native extensions.  This could take a while...
    Fetching: sqlite3-ruby-1.3.3.gem (100%)
    
    #######################################################
    
    Hello! The sqlite3-ruby gem has changed it's name to just sqlite3.  Rather than
    installing `sqlite3-ruby`, you should install `sqlite3`.  Please update your
    dependencies accordingly.
    
    Thanks from the Ruby sqlite3 team!
    
    <3 <3 <3 <3
    
    #######################################################
    
    Successfully installed sqlite3-1.3.6
    Successfully installed sqlite3-ruby-1.3.3
    2 gems installed
    Installing ri documentation for sqlite3-1.3.6...
    Installing ri documentation for sqlite3-ruby-1.3.3...
    Installing RDoc documentation for sqlite3-1.3.6...
    Installing RDoc documentation for sqlite3-ruby-1.3.3...
    
        3
  •  0
  •   Victor S    14 年前

    我通过以下建议使其发挥作用: http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/

    基本上,您可以从sqlite.org下载dll和shell文件,并确保在安装的每个Ruby版本中复制dll /bin 目录。您可以将shell文件放在系统路径的某个位置,我有一个文件夹 c:\bin . 然后你可以安装 pik gem install sqlite3

        4
  •  -1
  •   Dushyant    10 年前

    在gemfile.lock中替换为sqlite3(1.3.10-x64-mingw32)对我有效。

    推荐文章