Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ruby

rubygems

rvm

Using rvm, anytime I try to install or update a gem (or rubygems), I get the same error:

$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.6.6.gem (100%)
ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String

My system ruby however, works fine.

like image 990
David Beck Avatar asked Dec 03 '22 14:12

David Beck


2 Answers

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')
like image 71
Werner Altewischer Avatar answered Dec 20 '22 03:12

Werner Altewischer


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 : I'm on fedora but this should work on ubuntu / debian by using apt-get instead of dnf

like image 24
waghanza Avatar answered Dec 20 '22 03:12

waghanza