Skip to content

rbenv Ruby 3.0.6 "cannot load such file -- socket" #2624

Closed

Description

@roloand

I'm on a new Mac: M5 Pro, OS Tahoe 26.4. Installed rbenv fresh, and installed ruby 3.0.6 with it, using a patch as outlined in other threads. For the record, these are the commands I used:

brew install rbenv/tap/openssl@1.1
brew link --overwrite openssl@1.1
curl -fsSL https://github.com/ruby/ruby/commit/1dfe75b0beb7171b8154ff0856d5149be0207724.patch | rbenv install 3.0.6 --patch

Ruby 3.0.6 is installed successfully. However, when trying gem install bundler or just try to do anything, I get the following error (including stack trace that comes up when I try bundle install):

<internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- socket (LoadError)
        from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/net/protocol.rb:22:in `<top (required)>'
        from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/net/http.rb:23:in `<top (required)>'
from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb:1:in `<top (required)>'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendored_persistent.rb:11:in `require_relative'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendored_persistent.rb:11:in `<top (required)>'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/fetcher.rb:3:in `require_relative'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/fetcher.rb:3:in `<top (required)>'
        from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/cli/install.rb:48:in `run'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/cli.rb:253:in `block in install'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/settings.rb:131:in `temporary'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/cli.rb:252:in `install'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/cli.rb:31:in `dispatch'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/cli.rb:25:in `start'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/libexec/bundle:49:in `block in <top (required)>'
from /Users/username/.rbenv/versions/3.0.6/lib/ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from /Users/username/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/bundler-2.2.33/libexec/bundle:37:in `<top (required)>'
from /Users/username/.rbenv/versions/3.0.6/bin/bundle:23:in `load'
        from /Users/username/.rbenv/versions/3.0.6/bin/bundle:23:in `<main>'

I tried installing and using 3.1.0 on a separate directory and installing bundler and I'm getting the same error. I also ran the rbenv_doctor script and it didn't diagnose any issues. I'd appreciate any help with this, as I've been at it by myself for a whole day. Thanks!

Activity

  1. transferred this issue fromrbenv/rbenvon May 15, 2026
  2. locked and limited conversation to collaborators on May 15, 2026
  3. converted this issue into a discussion #2625 on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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