gpt4 book ai didi

ruby-on-rails - SQLite3安装中的问题

转载 作者:行者123 更新时间:2023-12-03 17:46:18 25 4
gpt4 key购买 nike

出现以下错误:

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,并且当前正在使用1.3.0版本的SQLite3进行安装。
我已经尝试过针对类似问题发布的解决方案。我正在使用Windows XP。

提前致谢。

最佳答案

我有这个问题。这是我找到的解决方案。它不是很漂亮,但是对我有用。就我而言,我正在使用cygwin。不使用cygwin可能有类似的方法,但是我不知道怎么做。

1)下载SQLite的源代码。我通过以下URL任意选择了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)从make创建它们的目录中复制sqlite3.exe和sqlite3.dll到路径中的某个位置。

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

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

关于ruby-on-rails - SQLite3安装中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3179626/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com