0

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?

Eyeslandic
  • 14,553
  • 13
  • 41
  • 54
Brian Piercy
  • 631
  • 1
  • 7
  • 22
  • Your question makes it sound like the behaviour is different on ruby 2.x and/or older Ubuntu versions, which isn't the case. – Tom Lord May 07 '21 at 11:28

2 Answers2

1

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

BroiSatse
  • 44,031
  • 8
  • 61
  • 86
  • Thanks for pointing out the Ruby behavior. Admittedly this sidetracked me from my initial problem - diagnosing why rubygems isn't able to install new gems. – Brian Piercy May 06 '21 at 23:37
0

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.

Brian Piercy
  • 631
  • 1
  • 7
  • 22