Skip to content

gem install sqlite3 --platform=ruby fails to build starting at 2.6.0 #634

Closed
@copiousfreetime

Description

@copiousfreetime

Installing the ruby platform gem

Admittedly I'm doing this on an older linux -- rockylinux 8.6 -- which is linux kernel 5.19.11-1ep.el8.x86_64 and glibc 2.28.

But that shouldn't affect a working ruby 3.4.4, from building sqlite3.

It does look like this started with sqlite3 2.6.0 which is also when the autotools was changed to autosetup -- so I wonder if that is actually the issue.

Gem Environment

RubyGems Environment:
  - RUBYGEMS VERSION: 3.6.9
  - RUBY VERSION: 3.4.4 (2025-05-14 patchlevel 34) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0
  - USER INSTALLATION DIRECTORY: /home/vagrant/.gem/ruby/3.4.0
  - CREDENTIALS FILE: /home/vagrant/.local/share/gem/credentials
  - RUBY EXECUTABLE: /home/vagrant/.rbenv/versions/3.4.4/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/vagrant/.rbenv/versions/3.4.4/bin
  - SPEC CACHE DIRECTORY: /home/vagrant/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/vagrant/.rbenv/versions/3.4.4/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0
     - /home/vagrant/.gem/ruby/3.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.org"]
     - :concurrent_downloads => 8
     - "benchmark" => false
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org

gem intall sqlite3 --platformr=ruby -v 2.6.0

Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
        ERROR: Failed to build gem native extension.

    current directory: /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ext/sqlite3
/home/vagrant/.rbenv/versions/3.4.4/bin/ruby extconf.rb
Building sqlite3-ruby using packaged sqlite3.
Extracting sqlite-autoconf-3490100.tar.gz into tmp/x86_64-redhat-linux/ports/sqlite3/3.49.1... OK
Running 'configure' for sqlite3 3.49.1... OK
Running 'compile' for sqlite3 3.49.1... OK
Running 'install' for sqlite3 3.49.1... OK
Activating sqlite3 3.49.1 (from /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1)...
checking for pkg-config for /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc... ["-I/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/include ", "", "-lsqlite3"]
checking for whether -L/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib is accepted as LDFLAGS... yes
checking for whether -lsqlite3 is accepted as LDFLAGS... yes
checking for whether -lm is accepted as LDFLAGS... yes
checking for whether -lz is accepted as LDFLAGS... yes
checking for whether -DUSING_PACKAGED_LIBRARIES is accepted as CPPFLAGS... yes
checking for whether -fvisibility=hidden is accepted as CFLAGS... yes
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no

Could not find sqlite3.
Please visit https://github.com/sparklemotion/sqlite3-ruby for installation instructions.


*** 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=${opt-dir}/include
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/vagrant/.rbenv/versions/3.4.4/bin/$(RUBY_BASE_NAME)
        --help
        --download-dependencies
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib
        --enable-system-libraries
        --disable-system-libraries
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib
        --with-sqlite-source-dir
        --with-sqlite-cflags
        --without-sqlite-cflags
        --with-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-dir
        --without-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-dir
        --with-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-include=${/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-dir}/include
        --without-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-include
        --with-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-lib=${/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-dir}/lib
        --without-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-lib
        --with-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-config
        --without-/home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0/ports/x86_64-redhat-linux/sqlite3/3.49.1/lib/pkgconfig/sqlite3.pc-config
        --with-pkg-config
        --without-pkg-config
        --enable-cross-build
        --disable-cross-build
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include=${sqlite3-dir}/include
        --without-sqlite3-include
        --with-sqlite3-lib=${sqlite3-dir}/lib
        --without-sqlite3-lib
        --with-sqlite3lib
        --without-sqlite3lib
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlcipher-dir
        --without-sqlcipher-dir
        --with-sqlcipher-include
        --without-sqlcipher-include
        --with-sqlcipher-lib
        --without-sqlcipher-lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/extensions/x86_64-linux/3.4.0/sqlite3-2.6.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0 for inspection.
Results logged to /home/vagrant/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/extensions/x86_64-linux/3.4.0/sqlite3-2.6.0/gem_make.out

Last working version 2.5.0

% gem install sqlite3 --platform=ruby  -v 2.5.0
Building native extensions. This could take a while...
Successfully installed sqlite3-2.5.0
Parsing documentation for sqlite3-2.5.0
Done installing documentation for sqlite3 after 3 seconds
1 gem installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions