【问题标题】:sqlite3 cannot be bundle in windows rails appsqlite3 不能捆绑在 windows rails 应用程序中
【发布时间】:2019-07-20 23:10:46
【问题描述】:

当前目录: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3 C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190227-5688-2rzd4d.rb extconf.rb 检查 sqlite3.h ... 否 sqlite3.h 丢失。首先从http://www.sqlite.org/ 安装 SQLite3。 * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

提供的配置选项: --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 --没有-make-prog --srcdir=。 --curdir --ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME) --with-sqlcipher --没有-sqlcipher --with-sqlite3-config --without-sqlite3-config --with-pkg-config --without-pkg-config --with-sqlcipher --没有-sqlcipher --with-sqlite3-dir --没有-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib

要查看此扩展无法编译的原因,请查看 mkmf.log,它可以 可以在这里找到:

C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/mkmf.log

extconf 失败,退出代码 1

Gem 文件将继续安装在 C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0 供检查。 结果记录到 C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/gem_make.out

安装 sqlite3 (1.4.0) 时出错,Bundler 无法继续。 确保gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org/' 在捆绑之前成功。

在 Gemfile 中: sqlite3

C:\Users\User\blog>gem install sqlite3 -v '1.4.0' --source 'https://rubygems.org 暂时增强 MSYS/MINGW 的 PATH... 安装所需的 msys2 包:mingw-w64-x86_64-sqlite3 构建原生扩展。这可能需要一段时间... 错误:安装 sqlite3 时出错: 错误:无法构建 gem 原生扩展。

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3

C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190227-8976-1h69dwp.rb extconf.rb 检查 sqlite3.h ...是的 检查 -lpthread 中的 pthread_create()... 是 检查 -ldl... 否 检查 dlopen()... 否 缺少函数 dlopen * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

提供的配置选项: --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 --没有-make-prog --srcdir=。 --curdir --ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME) --with-sqlcipher --没有-sqlcipher --with-sqlite3-config --without-sqlite3-config --with-pkg-config --without-pkg-config --with-sqlcipher --没有-sqlcipher --with-sqlite3-dir --没有-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib --with-pthreadlib --没有-pthreadlib --with-dllib --without-dllib

要查看此扩展无法编译的原因,请查看 mkmf.log,可在此处找到:

C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/mkmf.log

extconf 失败,退出代码 1

Gem 文件将继续安装在 C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0 以供检查。 结果记录到 C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/gem_make.out

C:\Users\User\blog>gem 取消链接 sqlite 错误:执行 gem 时 ... (Gem::CommandLineError) 未知命令取消链接

C:\Users\User\blog>gem install sqlite3 --universal 错误:执行 gem 时...(OptionParser::InvalidOption) 无效选项:--universal

C:\Users\User\blog>gem install sqlite3 -- --with-sqlite3-dir=/usr/local/Cellar/sqlite/3.8.8.1 暂时增强 MSYS/MINGW 的 PATH... 安装所需的 msys2 包:mingw-w64-x86_64-sqlite3 警告:mingw-w64-x86_64-sqlite3-3.26.0-1 是最新的 -- 跳过 使用以下命令构建本机扩展:'--with-sqlite3-dir=/usr/local/Cellar/sqlite/3.8.8.1' 这可能需要一段时间... 错误:安装 sqlite3 时出错: 错误:无法构建 gem 原生扩展。

current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0/ext/sqlite3

C:/Ruby26-x64/bin/ruby.exe -IC:/Ruby26-x64/lib/ruby/2.6.0 -r ./siteconf20190227-13444-5xb02v.rb extconf.rb --with-sqlite3-目录\=/usr/local/Cellar/sqlite/3.8.8.1 检查 sqlite3.h ...是的 检查 -lpthread 中的 pthread_create()... 是 检查 -ldl... 否 检查 dlopen()... 否 缺少函数 dlopen * extconf.rb 失败 * 由于某种原因无法创建 Makefile,可能缺乏必要 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

提供的配置选项: --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 --没有-make-prog --srcdir=。 --curdir --ruby=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME) --with-sqlcipher --没有-sqlcipher --with-sqlite3-config --without-sqlite3-config --with-pkg-config --without-pkg-config --with-sqlcipher --没有-sqlcipher --with-sqlite3-dir --with-sqlite3-include --without-sqlite3-include=${sqlite3-dir}/include --with-sqlite3-lib --without-sqlite3-lib=${sqlite3-dir}/lib --with-pthreadlib --没有-pthreadlib --with-dllib --without-dllib

要查看此扩展无法编译的原因,请查看 mkmf.log,可在此处找到:

C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/mkmf.log

extconf 失败,退出代码 1

Gem 文件将继续安装在 C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.0 以供检查。 结果记录到 C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/sqlite3-1.4.0/gem_make.out

【问题讨论】:

  • 你能准确点吗,这个信息似乎有点过分了!!
  • 您使用的是哪个版本的 Rails?
  • rails 5.2.2,ruby 2.6.1p33(2019-01-30 修订版 66950)[x64-mingw32]
  • ok @CharlesSkariah,由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。 (sqlite3 的生成文件)
  • @bottles 你能不能在 gemfile 中指定一个低版本的 sqlite3 而不是 1.4.0。1.3 左右的版本就足够了。

标签: ruby-on-rails ruby windows sqlite


【解决方案1】:

这是 Rails 5.2.2 (issue #35153) 的已知问题。

整理一下sqlite这个改动版本:

gem 'sqlite3', '~> 1.3.6'

【讨论】:

  • 哇,谢谢,它工作得很好,但是现在当我运行 Rails 服务器时,它给了我“你必须使用 Bundler 2 或更高版本来处理这个锁文件。”.. 虽然我使用的是 Bundler 版本 2.0.1(i也尝试过捆绑更新)
  • 删除您的锁定文件并重试
  • 做了并且得到了这个:check_for_activated_spec!':你已经激活了 bundler 2.0.1,但是你的 Gemfile 需要 bundler 1.17.2。在您的命令前添加 bundle exec 可以解决此问题。 (Gem::LoadError)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2013-05-19
  • 1970-01-01
  • 1970-01-01
  • 2012-05-29
  • 2017-06-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多