Most *nix machines will have Ruby already installed, it's much better suited, right out of the box, for this kind of work than Javascript is, having descended from Perl and all.
This is precisely the problem with languages that make things easier for novices, once you are beyond that stage you will see yourself doing a lot of work to accomplish simple tasks. This is the reason I switched to Perl, from Python. Python was good for a month, once I started running into more complicated tasks, Perl starting emerging as the clear winner.
I could see all the 'end's being kind of a pain. Perl's ugly terseness is arguably an advantage for that use case.
Javascript is not the be-all-end-all programming language. Neither is Ruby, Awk, Haskell, or Prolog. However knowing more than one will help you grow in your chosen profession.