我对Ruby和Rails非常陌生。我正在尝试安装sqlite3以便进行教程尝试,但是出现了一些问题。我使用的操作系统是Windows 10,并且使用的是ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32]
。
以下是我在运行gem install sqlite3-ruby
时遇到的安装错误。我也尝试运行了gem install sqlite3 --platform=ruby -- --with-sqlite3-include=c:/sqlite3/include --with-sqlite3-lib=c:/sqlite3/lib
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190217-3116-1d59gcv.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... no
checking for dlopen()... no
missing function dlopen
*** 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:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlcipher
--without-sqlcipher
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--with-pthreadlib
--without-pthreadlib
--with-dllib
--without-dllib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/mkmf.log
extconf failed, exit code 1
我已经从sqlite3官网下载了文件,以下是C:\sqlite3\
的文件夹结构:
sqldiff.exe
sqlite3.exe
sqlite3_analyzer.exe
include\shell.c
include\sqlite3.c
include\sqlite3.h
include\sqlite3ext.h
lib\sqlite3.def
lib\sqlite3.dll
我也已经将
sqldiff.exe, sqlite3.exe 和 sqlite3_analyzer.exe
复制到了 C:\Ruby26-x64\bin
中。
在我的环境变量中,我已经添加了 C:\sqlite3\
到 PATH
中,并创建了一个新的环境变量 sqlite3-dir
,指向 C:\sqlite3\
。请问是否有人能提供一些关于这个安装问题的帮助?
gem install sqlite3 -v 1.3.13
安装。 - knut