Some characters are replaced with spaces in Gem::Specification#files document · Issue #249 · rubygems/guides
https://guides.rubygems.org/specification-reference/#files The example code is the following require 'rake' spec.files = FileList['lib .rb', 'bin/*', '[A-Z]*', 'test/ *'].to_a # or without Rake... ...