Just Perl made string manipulation a lot easier then the standard shell. Also Perl got there first, which is slightly important.
For example, when shelling out, ruby lets you do it many ways, including the familiar backtick syntax. In python, you shell out with popen -- you need to contruct argument lists, wire up stdout and stderr, etc.
Python's way might actually be better (more explicit, less ambiguity, easier to handle errors) but often you might just want something that's simple and readable.
For the record, there are nicer python APIs and safer ruby APIs. These are just general comments on the different ecosystems.
from sh import git
print git('version')Python in my opinion is easier to write, and reading it is usually like reading plain english.
Python has a much larger community/ecosystem than ruby outside of web frameworks (rails kills django in popularity).
True preemptive multitasking probably also helped.
AppleScript doesn't come close, and on Windows sketchup is the only app I know of with anything similar, which happens to be Ruby. But you can't create great workflows in an ecosystem of 1, and I expect that ship has long since sailed.