安装 Ruby on Rails - Mac OS Lion
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6840719/
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
Installing Ruby on Rails - Mac OS Lion
提问by Hyman Eccleshall
I have downloaded Lion and looking to install Ruby on Rails I have been scanning the web for a way to do this but can't seem to find a easy way, could anyone point me in the correct direction.
我已经下载了 Lion 并希望安装 Ruby on Rails 我一直在浏览网络以寻找一种方法来做到这一点,但似乎找不到一种简单的方法,谁能指出我正确的方向。
Help Much Appreciated
帮助倍受赞赏
Thanks
谢谢
回答by Alain Beauvois
Below I try to resume my rails installation. It should work well.
下面我尝试恢复我的 rails 安装。它应该工作得很好。
1) Download Xcode from Apple Application Store :
1) 从 Apple Application Store 下载 Xcode:
use this link : xcode
使用此链接:xcode
2) Install xcode :
2)安装xcode:
Use finder=>applications to locate "Xcode installation icon and double-click on it to begin the installation
使用finder=>applications找到“Xcode安装图标并双击它开始安装
**2b.) For xcode 4.3. After installing xcode, launch it, navigate to Xcode->Preferences, Downloads tab. Install Command Line Tools. This will download and install C, compiler, loader and other command line utilities needed to compile & build the Ruby packages.
**2b.) 对于 xcode 4.3。安装 xcode 后,启动它,导航到 Xcode-> 首选项,下载选项卡。安装命令行工具。这将下载并安装编译和构建 Ruby 包所需的 C、编译器、加载器和其他命令行实用程序。
3) use a terminal to install git:
3)使用终端安装git:
gem install git
and put this line in your .bash_profile (create one if none exists) :
并将这一行放在您的 .bash_profile 中(如果不存在则创建一个):
export PATH=$PATH:/usr/local/git/bin/
4) use a terminal to install rvm:
4)使用终端安装rvm:
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
and run this command to update your .bash_profile :
并运行此命令来更新您的 .bash_profile :
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
5) use a terminal to install ruby 1.9.2 and rails:
5)使用终端安装ruby 1.9.2和rails:
rvm autolibs enable
rvm install 1.9.2
rvm --default 1.9.2
gem update
gem install rails
回答by Jeff Scott Ward
As of the latest version of lion (and having installed sass/compass/haml), if you type "rails" in the terminal and you dont have it, it will tell you to just do a sudo install right there. Hope its as easy for you as it was for me.
对于最新版本的 Lion(并且已经安装了 sass/compass/haml),如果您在终端中输入“rails”而您没有它,它会告诉您只需在那里进行 sudo 安装。希望它对你和我一样容易。

