command line tools for new 10.9 OSX for ruby gems?

前端 未结 8 899
[愿得一人]
[愿得一人] 2020-12-02 11:06

After installing OSX Mavericks 10.9 demo, Im getting this after running bundle

    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native ext         


        
相关标签:
8条回答
  • 2020-12-02 11:45

    I don't have enough reputation to comment, but Vyke's solution was helpful/required for me. My path to success after updating to mavericks was the following:

    • Install xcode from the appstore (terminal couldn't find it find it on the server)
    • Open xcode and accept the terms
    • Use biobonnie's solution to move the GCC file
    • rvm system
    • rvm get head
    • gem install yourgemname (in my case json)
    • bundle install
    • gem update rake

    ... and then I could get back to updating our jekyll/octopress based website.

    0 讨论(0)
  • 2020-12-02 11:48

    XCode 5.0.2 on Mavericks gave me the same error. Seems it wasn't fixed in 5.0.1 as expected.

    Trying xcode-select -- install brought up a dialog to install command line tools (which I'd already done twice), but failed because they "weren't found on the server". Maybe this approach is outdated?

    biobonnie's solution above worked for me:

    sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 
    

    After that, cocoapods finally install properly! Thanks! (Would upvote, but can't yet ... )

    0 讨论(0)
  • 2020-12-02 11:52

    I had to run both xcode-select --install and sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 to get bundle to install ffi

    0 讨论(0)
  • 2020-12-02 11:53

    TLDR:

    xcode-select --install
    

    In OS X 10.9, the command line developer tools are now installed on demand when they are used (this is the popup you mention seeing in a later comment).

    The first time something tries to use one of the command line tools, the popup will be presented and the original command will return with a message that the command line tools need to be installed and with an error code. In this case, the problem is that the ruby process is hiding the message about the command line tools being needed.

    If you wish to explicitly install the command line tools (instead of waiting for the popup to be triggered), you can run xcode-select --install. The command line tools package is also available as an independent download from http://developer.apple.com/downloads.

    Note that if you have Xcode installed on your system, you should no longer need the separate command line tools package, the tools in /usr/bin will automatically use the ones located inside of the Xcode application. This is why the Xcode UI no longer offers the option to install the command line tools for you.

    0 讨论(0)
  • 2020-12-02 11:54

    If you're using Ruby version manager (rvm) the following worked for me.

    Before you run the following, be sure to verify the symbolic link in /Users/yourusername/.rvm/rubies/. Mine looks like this...

    default -> /Users/yourusername/.rvm/rubies/ruby-1.9.3-p429
    

    If your sym link isn't set correctly, you can set it using...

    cd /Users/yourusername/.rvm/rubies/
    ln -s /Users/yourusername/.rvm/rubies/ruby-1.9.3-p429 default
    

    Then run the following from the command line

    rvm system
    rvm gemset export system.gems
    rvm 1.9.3 #use your Ruby version here
    rvm gemset import system.gems
    

    now you should be ready to install your gems

    gem install yourgemname
    
    0 讨论(0)
  • 2020-12-02 12:01

    I had this same problem installing gems after upgrading to OSX Mavericks. I saw this among the error messages:

    make: gcc-4.2: No such file or directory
    

    Which suggested that it's having trouble finding gcc. When I type "ls /usr/bin", I see that I have "gcc" but not "gcc-4.2". So I set up a symlink to tell it to look in "gcc" instead of "gcc-4.2", like so:

    sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
    

    This fixed my problem. Hope it helps.

    0 讨论(0)
提交回复
热议问题