ROR environment configuration in Mac OS X 10.7 (Lion) (RVM + REE + Rails 3 + MacVim)

Source: Internet
Author: User
Tags install homebrew

I always wanted to switch from ubuntu to mac platform to develop ROR, but there was no resource or time. The company launched a new MPO, so it was motivated.

There are many pitfalls in the installation and configuration environment, so record them for reference by yourself and others.

1. Xcode
Install Xcode before installing everything.

For Mac OS x 10.7, if Xcode 4.0 cannot be installed, the system prompts that the OS version is incorrect.

At the same time, it is recommended that you do not install Xcode 4.2 because the version mentioned in the prompt after rvm is installed will cause some package compilation failures. Some colleagues from Daniel had a hard time challenging the issue. It was a tragedy, and they installed gcc and so on. At last, they did a lot of work.

The most suitable version is Xcode 4.1 (4B110). Everything works normally during installation and use.

2. RVM
Install git before installation. You can refer to the github method.

Install rvm:

Bash <(curl-s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Important:

Echo '[[-s "$ HOME /. rvm/scripts/rvm "] &. "$ HOME /. rvm/scripts/rvm "# Load RVM function '> ~ /. Bash_profile
For the first time, I did not take this step, and some column tragedies occurred...

3. REE
During rvm install ree, a strange error is prompted. After searching for the error and finding that it is related to gcc, perform the following operations:

1) rvm remove ree

2) export CC = gcc-4.2

3) rvm install ree -- force

4. Switch to ree
Rvm use ree

You can use the ruby-v or which ruby command to check whether the gem env items are correct.

5. bundler
Sudo gem install bundler

6. Various gems
If there are various gem caches in the project, directly bundle install -- local

Otherwise, set your own Gemfile and bundle install

7. MacVim
Vim is so used to it, and I heard my colleagues say that TextMate is not updated, so I gave up the idea of changing IDE.

Download the MacVim-7_3-53.tbz and unzip it

./Configure

Make

Make install

Put the generated MacVim. app in the/Applications directory, or drag it to the dock.

Put the generated mvim under/usr/bin. If you are familiar with gvim, you can make a soft link: sudo ln-s/usr/bin/mvim/usr/bin/gvim

8. vim plugins
The plug-in I installed includes:

Rails. vim, Nerd Commenter, Buf Explorer, Fuzzy Finder, Nerd Tree, grep. vim, Super Tab, Taglist

Two pitfalls:

1) exuberant ctags do not belong to vim plugin and must be downloaded, compiled, and installed by yourself. Apple has a ctags in/usr/bin, but it is different from this one. Therefore, you need to modify the path or create a link if necessary.

2) rails. vim depends on xargs. The xargs in the Apple system does not work either, so you need:

A. Install homebrew

B. brew install findutils

C. In. vimrc, add let Grep_Xargs_Path = 'gxargs ', or modify grep. vim to change let Grep_Xargs_Path = 'xargs' to 'gxargs'

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.