How can I install Ruby 1.9.3 in Mac OS X Lion?

后端 未结 11 518
南旧
南旧 2020-12-04 12:21

I am trying to install Ruby 1.9.3 but am having problems. I installed RVM, then typed:

rvm install 1.9.3

The output says:

         


        
11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 12:27

    RVM needs gcc-4.2 to be able to install ruby 1.9.3. Unfortunately Lion does not include anymore gcc-4-2, just the llvm version:

    lrwxr-xr-x  1 root  wheel  12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
    

    If you have Lion but upgraded from Snow Leopard it is likely that you still have gcc-4.2 If you have a brand new installation of Lion you should download gcc-4.2. I recommned downloading this package.

    https://github.com/kennethreitz/osx-gcc-installer
    

    Check that you have gcc-4.2 installed now:

    -rwxr-xr-x  1 root  wheel  113024 16 may  2011 /usr/bin/gcc-4.2
    lrwxr-xr-x  1 root  wheel      12 15 feb 17:21 /usr/bin/gcc -> llvm-gcc-4.2
    

    Now you can install ruby 1.9.3 as usual:

    rvm install 1.9.3
    rvm use 1.9.3 --default
    

提交回复
热议问题