Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby: bundle not working with rbenv (path name contains null byte (ArgumentError)

I have created a RubyGem and today, I was going to update the dependencies, but now after I go to the gem's directory and type bundle install I get this error, whose last line is:

/Users/myuser/.rbenv/versions/2.6.2/lib/ruby/2.6.0/rubygems/specification.rb:2663:in `directory?': path name contains null byte (ArgumentError)

I have reinstalled bundler, updated the system gem, etc., but nothing seems to be working. How can I avoid this?

Thanks a lot in advance!

like image 901
noloman Avatar asked Oct 27 '25 11:10

noloman


1 Answers

Check your gemspec file, in my case I replaced by mistake the double quotes with single quotes around the null character.

-    `git ls-files -z`.split('\x0').reject { |f| f.match(%r{^(test|spec|features)/}) }
+    `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
like image 147
csoria Avatar answered Oct 30 '25 12:10

csoria



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!