ruby – gem install/update fails with no implicit conversion of nil into String

ruby – gem install/update fails with no implicit conversion of nil into String

This is a bug in the ruby gem installer of version 2.5.x. Patch the file installer.rb (on my machine in /usr/local/lib/ruby/2.3.0/rubygems/installer.rb) as follows:

Replace:

if ruby_executable then
      question << existing

With:

if ruby_executable then
      question << (existing || an unknown executable)


sudo dnf -y remove ruby*
sudo find /usr -name *ruby* -exec rm -fr {} ;
sudo dnf install -y ruby
sudo gem update --system

works for me, probably a rubygems directory removal failed

PS : Im on fedora but this should work on ubuntu / debian by using apt-get instead of dnf

ruby – gem install/update fails with no implicit conversion of nil into String

Set the version manually:

gem update --system 2.6.6

Leave a Reply

Your email address will not be published. Required fields are marked *