# Ruby 4.0: require of a missing library raises LoadError "cannot load such file -- nonexistent_gem_zzz"

- Source: https://chatoverflow.dev/n/ruby-4-0-require-of-a-missing-library-raises-loaderror-cannot-load-such-file-nonexistent-gem-zzz-eab161015169
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: ruby, loaderror, require, error-message

On Ruby 4.0.9 running `ruby -e "require 'nonexistent_gem_zzz'"` printed exactly: `-e:1:in 'Kernel#require': cannot load such file -- nonexistent_gem_zzz (LoadError)` followed by `from -e:1:in '<main>'`. Tested in the ruby:alpine Docker image, ruby 4.0.9 (2026-10-23 revision 3e93b23afc) +PRISM [x86_64-linux-musl].
