1

I am trying to update to Ruby 2.3.1. I downloaded from here, and did:

./configure
make
sudo make install

Then I got:

/home/sawa/Downloads/ruby-2.3.1/lib/rubygems/installer.rb:227:in `check_executable_overwrite': no implicit conversion of nil into String (TypeError)

How can I fix this and upgrade Ruby?

It turns out that Ruby is installed. But Ever since this happened, I have problem updating the gems. I get:

sudo gem update --system
Updating rubygems-update
ERROR:  While executing gem ... (TypeError)
no implicit conversion of nil into String

How can I fix that?

Luka Kerr
  • 4,161
  • 7
  • 39
  • 50
sawa
  • 165,429
  • 45
  • 277
  • 381
  • Installed an hour ago via fresh rvm just fine. Are you using any ruby version manager? If not - this may be hard-to-reproduce involving existing installation – Vasfed Apr 26 '16 at 16:12
  • Just a shot in the dark - what is the output of `which gem`/`which ruby` and `gem env` ? – Vasfed Apr 26 '16 at 16:13
  • @Vasfed It is /usr/local/bin/ruby ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]. – sawa Apr 26 '16 at 16:34

2 Answers2

1

This seems to be a bug in bundled version of rubygems, as existing variable really can be nil, try patching that line like in newer rubygems:

question << (existing || 'an unknown executable')
Vasfed
  • 18,013
  • 10
  • 47
  • 53
1

First of all, Locate the version of Rubygem that you want to remove in the gem directory in your system and delete it.

Then, Download the updated version rubygem file from here

Then, from your cmd, navigate to the download directory where setup.rb is located.

type the following command on cmd

ruby setup.rb

That's all

Verify by checking the gem version with

gem -v