简体   繁体   English

安装Ruby on Rails - Mac OS Lion

[英]Installing Ruby on Rails - Mac OS Lion

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 谢谢

Below I try to resume my rails installation. 下面我尝试恢复我的rails安装。 It should work well. 它应该运作良好。

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. ** 2b。)对于xcode 4.3。 After installing xcode, launch it, navigate to Xcode->Preferences, Downloads tab. 安装xcode后,启动它,导航到Xcode-> Preferences,Downloads选项卡。 Install Command Line Tools. 安装命令行工具。 This will download and install C, compiler, loader and other command line utilities needed to compile & build the Ruby packages. 这将下载并安装编译和构建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

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. 从狮子的最新版本开始(并安装了sass / compass / haml),如果你在终端输入“rails”并且你没有它,它会告诉你只需要在那里做一个sudo安装。 Hope its as easy for you as it was for me. 希望它对你来说和我一样容易。

就个人而言,我已经按照此链接在Mac OS X Lion上使用rvm安装rails,我使用pow在本地运行我的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM