! ! ! Be sure to see the version number on the title.
Which can see Mac OS X 10.7.3 pre-installed Ruby-1.8.7, but the pothole is MacBook as a UNIX system without GCC and make, so I started tossing my MacBook.
In fact, I want GCC very easy, I have a pit, I have a pit here, I have 1.7G, although I don’t use Xcode, but I need to use this time and I may use it. Interesting to see the Xcode, so I am driving MacBook and then sleep, let the appstore goelf to install Xcode.
I have been installed this morning, but which, still there is no GCC, I started to fall into the abyss of tossing, I used the find command to put the GCC, then in .bash_profile, add its path, install RUBY Still an error, can’t find the executable C command.
Ok, now I need to go on the right track, I don’t care seriously.
I think the appStore is automatically installed to install the necessary tools.
Open Xcode, Menu Xcode >> Open Developer Tool >> More Developer Tools, then Safari appears, start registering the information and then goes to the Apple Developer download site, search “UNIX” first results It is a Command Line Tools to download it. It is recommended to use Thunder for Mac, download it, it will give us a command line tool to include the command line tools, including the GCC and Make I want, you don’t need to turn back Terminal, whic GCC and Make Have.
At this time, there is a problem, the Mac GCC is apple specialization, and it is said to have an optimization of compilation, but this stuff has a problem under Ruby, which is not supported by LLVM-GCC, ok, except GCC There is also a CLANG compilation tool.
Now you can start installing ruby, just install Ruby peace, but add -with-gcc = clang, specify the compiler when configuring.
./configuration –prefix = / OPT / RUBY-1.9.3 –With-GCC = CLANG
I will not listed in other orders.
After installing ~ / .bash_profile, add the environment variable to restart Terminal is OK, now not only Ruby is successfully installed, you can also install other software, here, here, you can use the GCC to use the system GCC, that is, just need Plus – With-GCC = CLANG parameters.
I still don’t know if there is any other problem since I installed, because I saw a lot of Warning in installation, now I am now in the middle of the night, I only read the version of the commands such as Ruby, Gem, Ri, I hope to use the future There will be no problem. However, it is easy to delete it yourself, in case, I find some other installation methods.
Installation through RVM, reference link, here to keep it, Stackoverflow said RVM Install 1.9.3 –With-GCC = Clang
This command is not necessarily correct, may be caused by the RVM version, you can try RVM install 1.9.3 -c –with-gcc = clang, – prefix = / opt / ruby-1.9.3 Install by Macports, enter Macport Home