Do programs written in Ruby work on both Windows and Linux?

1

It's a question I have about this programming language.

Java , for example, has no OS distinction, as it has something like an internal SO , so no you need a specific port for each SO . The same code works for both Linux and Windows, however, there are languages that have distinction, as in the case of C. But I learned Ruby a short time ago, and after some tests I realized that I did not have to do a specific port for my code to run for each SO (Windows and Linux).

  • Ruby does not require specific ports for a certain program run in each SO ?
  • The program works on both systems (Windows and Linux) regardless of which one you choose to develop?

Thank you to anyone who can answer me.

Note: SO = Operating System

    
asked by anonymous 27.09.2017 / 05:29

1 answer

1

The Ruby platform has the Ruby MRI - The implementation reference for interpreters of this language, written in C .

The Ruby specification tests repository informs you that Ruby MRI in> runs on 30 platforms:

  

ruby / spec is known to be tested in these implementations for every   commit:

     
  • MRI on 30 platforms and 4 versions
  •   
  • JRuby on Travis for both 1.7 and 9.x
  •   
  • TruffleRuby on Travis
  •   
  • Opal on Travis
  •   
In summary, the compatibility of a Ruby application with different platforms could be broken if algorithms interact directly with particular functionalities from an Operating System (eg, Windows, Linux, MacOS).

    

27.09.2017 / 06:17