Skip to content

Use Ruby with latest rubygems version#128

Merged
santiagorodriguez96 merged 3 commits intomasterfrom
sr--ci--use-ruby-with-latest-rubygems
Mar 3, 2026
Merged

Use Ruby with latest rubygems version#128
santiagorodriguez96 merged 3 commits intomasterfrom
sr--ci--use-ruby-with-latest-rubygems

Conversation

@santiagorodriguez96
Copy link
Copy Markdown
Collaborator

The CI was failing with the following error when running with Ruby 3.0 against devise 3.0.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/gems/sqlite3-2.0.4/ext/sqlite3
/opt/hostedtoolcache/Ruby/3.0.7/x64/bin/ruby -I
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0 -r
./siteconf20260303-2303-pvjn4q.rb extconf.rb
Building sqlite3-ruby using packaged sqlite3.
*** 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.

	from extconf.rb:51:in `configure_packaged_libraries'
	from extconf.rb:17:in `configure'
	from extconf.rb:284:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/gems/sqlite3-2.0.4
for inspection.
Results logged to
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/sqlite3-2.0.4/gem_make.out

/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in
`run'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:159:in
`build_extension'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:193:in
`block in build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in
`each'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/installer.rb:837:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:28:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/source/rubygems.rb:204:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:62:in
`apply_func'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:57:in
`block in process_queue'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:54:in
`loop'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:54:in
`process_queue'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:91:in
`block (2 levels) in create_threads'

An error occurred while installing sqlite3 (2.0.4), and Bundler cannot continue.

In devise_5_0.gemfile:
  sqlite3

This is an known issue for Rubies 2.6 up to 3.1 when used with rubygems older than v3.4.9: ruby/rubygems#6611.

This commits uses setup-ruby's rubygems params so that the latest available rubygems version is used for our rubies.

References:

The CI was failing with the following error when running with Ruby 3.0
against `devise` 3.0.

```
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/gems/sqlite3-2.0.4/ext/sqlite3
/opt/hostedtoolcache/Ruby/3.0.7/x64/bin/ruby -I
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0 -r
./siteconf20260303-2303-pvjn4q.rb extconf.rb
Building sqlite3-ruby using packaged sqlite3.
*** 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.

	from extconf.rb:51:in `configure_packaged_libraries'
	from extconf.rb:17:in `configure'
	from extconf.rb:284:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/gems/sqlite3-2.0.4
for inspection.
Results logged to
/home/runner/work/devise-webauthn/devise-webauthn/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/sqlite3-2.0.4/gem_make.out

/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in
`run'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:47:in
`block in build'
  /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/tempfile.rb:317:in `open'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:159:in
`build_extension'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:193:in
`block in build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in
`each'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/rubygems/installer.rb:837:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:28:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/source/rubygems.rb:204:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:62:in
`apply_func'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:57:in
`block in process_queue'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:54:in
`loop'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:54:in
`process_queue'
/opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/bundler/worker.rb:91:in
`block (2 levels) in create_threads'

An error occurred while installing sqlite3 (2.0.4), and Bundler cannot continue.

In devise_5_0.gemfile:
  sqlite3
```

This is an known issue for Rubies 2.6 up to 3.1 when used with rubygems
older than v3.4.9: ruby/rubygems#6611.

This commits uses `setup-ruby`'s `rubygems` params so that the latest
available `rubygems` version is used for our rubies.

References:
- ruby/rubygems#6611
- https://github.com/ruby/setup-ruby/blob/896e71e063dc0933bb442a54e949d75291991ecb/action.yml#L11-L17
@santiagorodriguez96 santiagorodriguez96 merged commit d7106e9 into master Mar 3, 2026
25 checks passed
@santiagorodriguez96 santiagorodriguez96 deleted the sr--ci--use-ruby-with-latest-rubygems branch March 3, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants