Skip to content

Remove unused kconv require for Ruby 3.4 compatibility#91

Merged
jonmbake merged 2 commits intomasterfrom
copilot/fix-kconv-dependency-issue
Feb 16, 2026
Merged

Remove unused kconv require for Ruby 3.4 compatibility#91
jonmbake merged 2 commits intomasterfrom
copilot/fix-kconv-dependency-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Ruby 3.4 removed kconv from stdlib, causing plugin load failures. The library was required but never used in the codebase.

Changes

  • Removed unused require 'kconv' from lib/omniauth-ldap/adaptor.rb
# Before
require 'rack'
require 'net/ldap'
require 'net/ntlm'
require 'sasl'
require 'kconv'  # Unused, causes LoadError on Ruby 3.4+

# After
require 'rack'
require 'net/ldap'
require 'net/ntlm'
require 'sasl'

No kconv methods (Kconv, toutf8, tosjis, etc.) are referenced anywhere in the codebase.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • stdgems.org
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Ruby 3.4 Compatibility: LoadError - cannot load such file -- kconv</issue_title>
<issue_description>## Environment

  • Discourse version: latest (tests-passed branch)
  • discourse-ldap-auth: latest compatible version
  • Ruby version: 3.4.7
  • Docker base image: discourse/base:2.0.20260209-1300

Problem

The plugin fails to load during bundle exec rake db:migrate with the following error:

LoadError: cannot load such file -- kconv (LoadError)
/var/www/discourse/plugins/ldap/lib/omniauth-ldap/adaptor.rb:8:in '<main>'

Root Cause

The kconv library was removed from Ruby's standard library in Ruby 3.4 and must now be added as an explicit gem dependency.

Reference: https://stdgems.org/kconv/

Impact

  • Plugin cannot be installed on systems using Ruby 3.4+
  • Blocks Discourse container rebuild
  • Affects all users upgrading to newer Discourse versions that use Ruby 3.4

Suggested Fix

Add kconv gem to the plugin's gemspec or Gemfile:

gem 'kconv'

Full Stack Trace

LoadError: cannot load such file -- kconv (LoadError)
/var/www/discourse/vendor/bundle/ruby/3.4.0/gems/bootsnap-1.19.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in 'Kernel#require'
/var/www/discourse/vendor/bundle/ruby/3.4.0/gems/zeitwerk-2.7.3/lib/zeitwerk/core_ext/kernel.rb:34:in 'Kernel#require'
/var/www/discourse/plugins/ldap/lib/omniauth-ldap/adaptor.rb:8:in '<main>'
/var/www/discourse/plugins/ldap/plugin.rb:14:in 'Kernel#require_relative'
/var/www/discourse/plugins/ldap/plugin.rb:14:in 'Plugin::Instance#activate!'
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix LoadError for kconv in Ruby 3.4 compatibility Remove unused kconv require for Ruby 3.4 compatibility Feb 16, 2026
Copilot AI requested a review from jonmbake February 16, 2026 14:57
@jonmbake jonmbake marked this pull request as ready for review February 16, 2026 15:20
@jonmbake jonmbake merged commit 0f5749c into master Feb 16, 2026
5 checks passed
@jonmbake jonmbake deleted the copilot/fix-kconv-dependency-issue branch February 16, 2026 15:22
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.

Ruby 3.4 Compatibility: LoadError - cannot load such file -- kconv

2 participants