Ruby 3.0 install on Ubuntu 20.10 is dead in the water

166 views Asked by At

I deleted all older Ruby libs and compiled v3.0 from the command line (no pkg managers were used.)

The binary's CLI can handle arguments:

$ruby -v --> ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]

irb is alive:

$irb --> irb(main):001:0>

But launching Ruby w/o any CLI arguments is dead. No response.

The RubyGems package manager is alive, but fails (Net::OpenTimeout) when trying to download from rubygems.org.

I'm flummoxed. Any ideas?

2

There are 2 answers

1
BroiSatse On BEST ANSWER

This is normal ruby behaviour. ruby is a command line program and is optimised to be used as a part of a command line pipeline

$> echo "puts(2 ** 5)" | ruby 
$= 32

When executed without any argument, you connect it to an infinite stream of stdin which might seem like being unresponsive, but in fact is actively parsing the input. You can check it by simply typing end which will terminate program with syntax error.

The normal way of using ruby executable is to give it a file to execute:

ruby my_script.rb

You can see more options wiht ruby -h

0
Brian Piercy On

The gem install problem seems to be related to the rubygems API having problems with IPv6: gem cannot access rubygems.org.

I've edited my copy of /etc/gai.conf, and the gem install problem seems to have disappeared.