Why does Mac OS X come with ruby/rails?

26,324

Solution 1

As others have noted, OS X comes with various open source packages pre-installed. While this can be a nice convenience, the packages often are only updated to new versions as part of a major OS X release (like 10.5 to 10.6). Also, some packages are used elsewhere by other parts of OS X and there is no easy way to know which. In general, Apple assumes (and you should, too) that everything under /System/Library and /usr/, except for /usr/local/, is part of OS X and is administered by Apple. You should not attempt to remove or modify files in those hierarchies. That includes just about all of the open source packages, including Ruby.

Instead, to upgrade an existing package, the right approach is to install a new version in a separate location (say, /usr/local/) and invoke the new version by an absolute path reference (/usr/local/bin/ruby) or manipulating the shell PATH environment variable, if necessary. /usr/local/ is often used if installing directly from source. Many people prefer to use one of the 3rd-party open source package distributors, such as MacPorts, Fink, or Homebrew, each of which has its own package manager and installation locations.

Solution 2

No the OS does not use, it is just that Apple wants to make her products a bit more appealing to developers. (there is also Python preinstalled along with some other packets).

You can safely update your Ruby, Rails, Gems but the default Ruby version is a bit outdated. Check RVM so that you can install different Rubies in your system

Solution 3

Consider Rubystack if you want to play with more up-to-date environments without interfering with the existing versions. Disclaimer, I am one of the developers of RubyStack. It is freely available under the open source Apache 2.0 License.

Share:
26,324
Adam Harte
Author by

Adam Harte

I am a digital media developer who loves building apps, games, and things for the web.

Updated on July 22, 2021

Comments

  • Adam Harte
    Adam Harte almost 3 years

    Why does Mac OS X come with ruby and ruby on rails pre-installed? Does the OS actually use it at all? Can I update my Ruby, Rails or Gem versions safely without something spitting the dummy?

  • PJP
    PJP over 13 years
    How do you know that Apple doesn't use Ruby, Python, Perl or TCL? According to my checks there is system use of all four languages: Try locate *.py | grep ^/usr | grep -v /System with their standard extensions.
  • Dr. belisarius
    Dr. belisarius over 12 years
    You should disclose your affiliation with the company each time you mention your product. Otherwise, it is considered as spam here.
  • Daniel Lopez
    Daniel Lopez over 12 years
    I have done so in most other questions and is clearly specified in my profile as well. BitNami is not a company, and we do not make any money with the stacks (though it is sponsored by one and we provide support and services to some other open source companies such as Sugar, Alfresco, etc.). In any case, I have now updated my response. Also, I believe there was no need to downvote the answer as it is directly related to the topic.
  • Dr. belisarius
    Dr. belisarius over 12 years
    I did not downvote. The spam flag works like that. It will go away after a while now that you updated your answer. Note however that you really should specify your affiliation in each of your answers, it is not enough to have it on your profile, so you should check that all your answers recommending your products include a disclaimer