gpt4 book ai didi

Windows 10 上的 Ruby sqlite3 gem 安装问题

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

我对 ruby​​ 和 rails 很陌生。我正在尝试安装到 sqlite3 以尝试教程并遇到问题。我在 Windows 10 上使用 ruby 2.6.1p33(2019-01-30 修订版 66950)[x64-mingw32]

这是我在运行 gem install sqlite3-ruby 时遇到的安装错误。我也试过运行

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.exeC:\Ruby26-x64\bin。在我的环境变量中,我添加了 C:\sqlite3\PATH 并且还创建了一个新的环境变量 sqlite3-dir 指向 C:\sqlite3\

有人可以为这个安装问题提供一些帮助吗?

最佳答案

在项目 Gemfile 文件中添加 gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec" 有效。之后运行 bundle install。确保在机器上安装了 git。这是 github link

关于Windows 10 上的 Ruby sqlite3 gem 安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54738267/

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