Um programa Ruby pode ser armazenado em um arquivo? Como executá-lo?
Sim. Para executá-lo, veja:
Unix:
% cat > test.rb
print "hello world\n"
^D
% cat test.rb
print "hello world\n"
% ruby test.rb
hello world
Dos:
C:\ruby> copy con: test.rb
print "hello world\n"
^Z
C:\ruby> type test.rb
print "hello world\n"
C:\ruby> ruby test.rb
hello world
Sim, se não for utilizada nenhuma biblioteca peculiar ao SO.
A partir do prompt shell (representado aqui por "%", mas não digite o %), digite: % ruby -v