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

后端 未结 12 1842
说谎
说谎 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:00

    As suggested in many answers, the easiest thing to do is to compile The Ruby Racer native extensions with Apple GCC 4.2 (instead of the version installed with Xcode).

    If you're using MacPorts you shouldn't have to manually deal with setting up symbolic links for the GCC binaries. The port select command does it for you. If you haven't updated MacPorts since installing Mavericks, do a sudo port selfupdate. With MacPorts up-to-date, try the following:

    # If you don't have it, install the port for Apple's GCC 4.2
    sudo port install apple-gcc42 
    
        # OR
    
    # If you had apple-gcc42 already (before Mavericks), update it
    sudo port upgrade apple-gcc42
    
    
    # Same result as manual symlinking of GCC in other answers
    sudo port select gcc apple-gcc42 && hash -r
    
    # Install therubyracer, will install libv8 gem dependency
    #  *note* if you have any existing versions of these gems, remove them
    gem install therubyracer
    
    # Restore GCC to system default (optional)
    sudo port select gcc none && hash -r
    

    In general this procedure (sudo port select gcc [version]) will work any time you want to use a specific GCC version instead of the one installed by Xcode (Apple LLVM v5 for 10.9 Mavericks/Xcode 5).

提交回复
热议问题