“gem install therubyracer -v '0.10.2'” on osx mavericks not installing

后端 未结 12 1911
说谎
说谎 2020-11-28 17:22

Trying to install therubyracer on mavericks using \"gem install therubyracer -v \'0.10.2\'\" but i am getting the following error:

/Users/dennischen/.rvm/rub         


        
12条回答
  •  我在风中等你
    2020-11-28 18:19

    I just had the same problem and one solution is currently to use apple-gcc42 instead of clang to compile both gems :

    brew install apple-gcc42
    

    And then you have the choice between doing some symlinks in /usr/bin for {gcc,g++,c++} binaries :

    sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/gcc
    sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 /usr/bin/g++
    sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 /usr/bin/cpp
    

    In fact g++ should be enough.

    Or...you could export CC/CXX/CPP environment variables with paths corresponding to the binaries created by homebrew. That's surely a cleaner workaround.

    A third solution is to download Xcode 4.6.3 and install it in the Applications folder. Then, enter in the terminal:

    sudo xcode-select --switch /Applications/Xcode4.6.3.app/Contents/Developer
    gem install therubyracer
    

    Once the gem has been installed you can switch back to Xcode 5.0 :

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    

提交回复
热议问题