The compiler failed to generate an executable file. (RuntimeError)

前端 未结 10 1165
面向向阳花
面向向阳花 2020-12-09 04:06

I recently upgraded to OS Mountain Lion. A project I\'m working on requires gem sys-proctable as a dependency, but when I run bundle install I get:



        
相关标签:
10条回答
  • 2020-12-09 04:31

    I can't repeat enough how frustrating it was for me when I had the SAME issue on Mountain Lion. I ultimately upgraded my OS to Mavericks after I read that there were some GCC issues with Mountain Lion. I still had the same error :/

    The ONLY thing that worked was reinstalling ruby after installing the command line tools.

    "For future visitors, this worked for me. Not that it should matter but I installed rvm with brew. Xcode and Xcode CLT was already installed. I simply had to (no sudo throughout any of this) rvm use 2.0.0, then xcode -license, agree to the license then rvm reinstall 2.0.0. last step very important, indeed"

    Then $ gem install rails

    This fixed my issues perfectly. This blog gives a great walkthrough with screenshots on how to install Mac Development Tools (Command Line Tools) multiple ways (http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/)

    0 讨论(0)
  • If you're using rbenv and homebrew:

    brew tap homebrew/dupes ; brew install apple-gcc42
    
    0 讨论(0)
  • 2020-12-09 04:48

    It turns out this is a bug in RailsInstaller OSX 1.0.3 - (Found that out while reading Problems installing Ruby on Mountain Lion - ruby 1.9.3 wont' compile)

    I needed to change /etc/rvmrc to contain this:

    umask g+w
    export -a rvm_configure_env
    rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')
    

    For more info see: https://github.com/railsinstaller/railsinstaller-nix/issues/10

    0 讨论(0)
  • 2020-12-09 04:48

    I was getting the following error during "bundle install":


    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    
            /Users/bob/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
    creating Makefile
    
    make
    compiling generator.c
    make: /usr/bin/gcc-4.2: No such file or directory
    make: *** [generator.o] Error 1
    
    
    Gem files will remain installed in /Users/bob/.rvm/gems/ruby-1.9.3-p194@storefront/gems/json-1.8.0 for inspection.
    Results logged to /Users/bob/.rvm/gems/ruby-1.9.3-p194@storefront/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
    An error occurred while installing json (1.8.0), and Bundler cannot continue.
    Make sure that `gem install json -v '1.8.0'` succeeds before bundling.
    

    After updating Xcode and installing CLT, doing the following took care of the issue:

    bundle clean --force
    
    bundle install
    
    0 讨论(0)
提交回复
热议问题