为什么 Mac OS X 带有 ruby/rails?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3474875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why does Mac OS X come with ruby/rails?
提问by Adam Harte
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?
为什么 Mac OS X 预装了 ruby 和 ruby on rails?操作系统真的使用它吗?我可以安全地更新我的 Ruby、Rails 或 Gem 版本吗?
回答by Ned Deily
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/Libraryand /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.
正如其他人所指出的,OS X 预装了各种开源软件包。虽然这很方便,但这些软件包通常只作为主要 OS X 版本(如 10.5 到 10.6)的一部分更新到新版本。此外,OS X 的其他部分在其他地方使用了一些软件包,并且没有简单的方法来知道是哪个。通常,Apple 假定(您也应该)除了/System/Library和下的所有内容都是OS X 的一部分并由 Apple 管理。您不应尝试删除或修改这些层次结构中的文件。这包括几乎所有的开源包,包括./usr//usr/local/Ruby
Instead, to upgradean 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 PATHenvironment 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.
相反,要升级现有包,正确的方法是在单独的位置(例如/usr/local/)安装新版本,并在必要时通过绝对路径引用 ( /usr/local/bin/ruby) 或操作 shellPATH环境变量来调用新版本。 /usr/local/如果直接从源代码安装,则通常使用。许多人更喜欢使用第 3方开源软件包分发程序之一,例如MacPorts、Fink或Homebrew,每个都有自己的软件包管理器和安装位置。
回答by PanosJee
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).
不,操作系统不使用,只是苹果想让她的产品对开发人员更具吸引力。(还预装了 Python 以及其他一些数据包)。
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
您可以安全地更新您的 Ruby、Rails、Gems,但默认的 Ruby 版本有点过时。检查 RVM,以便您可以在系统中安装不同的 Ruby
回答by Daniel Lopez
Consider Rubystackif 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.
如果您想在不干扰现有版本的情况下使用更新的环境,请考虑使用Rubystack。免责声明,我是 RubyStack 的开发人员之一。它在开源 Apache 2.0 许可下免费提供。

