RVM ruby installation errors - Mac

21,116

Solution 1

rvm install 1.9.3 --with-gcc=clang

Solution 2

If you have a new install of XCode, you'll need to:

1.) open it

2.) go to: Preferences>Downloads>Command Line Tools

3.) install the Command Line Tools

4.) then run the following in Terminal:

rvm install 1.9.3 --with-gcc=clang

Solution 3

Did you install libyaml package before installing ruby 1.8.7?

Since rvm is showing a Error running 'make, you should also install readline package using

rvm pkg install readline

You should install all the necessary rvm packages before installing any version of ruby. If you have installed any version of ruby before installing those packages, you should remove them using

rvm remove 1.8.7
rvm remove 1.9.2
rvm remove 1.9.3

And then install them again using

rvm install 1.8.7
rvm install 1.9.2
rvm install 1.9.3

Solution 4

I used homebrew to install GCC-4.2, then symlinked it from /usr/local/bin to /usr/bin. This fixed this issue for me.

Share:
21,116
Très
Author by

Très

Updated on February 16, 2020

Comments

  • Très
    Très about 4 years

    I have tried to install each of the following three versions of Ruby via RVM, each with their own set of errors. I'm more concerned with getting the last one working so I'll focus on that.

    rvm install 1.8.7
    rvm install 1.9.2
    rvm install 1.9.3
    

    rvm install 1.9.3 (bash output)

    14:10:41: ~/.rvm/config $ 
    rvm install 1.9.3
    Fetching yaml-0.1.4.tar.gz to /Users/dionnesaunders/.rvm/archives
    Extracting yaml-0.1.4.tar.gz to /Users/dionnesaunders/.rvm/src
    ERROR: Error running 'tar mzxf /Users/dionnesaunders/.rvm/archives/yaml-0.1.4.tar.gz -C  /Users/dionnesaunders/.rvm/src ', please read /Users/dionnesaunders/.rvm/log/ruby-1.9.3-p0/yaml/extract.log
    Configuring yaml in /Users/dionnesaunders/.rvm/src/yaml-0.1.4.
    ERROR: Error running ' ./configure --prefix="/Users/dionnesaunders/.rvm/usr"  ', please read /Users/dionnesaunders/.rvm/log/ruby-1.9.3-p0/yaml/configure.log
    Compiling yaml in /Users/dionnesaunders/.rvm/src/yaml-0.1.4.
    ERROR: Error running 'make ', please read /Users/dionnesaunders/.rvm/log/ruby-1.9.3-p0/yaml/make.log
    Database file /Users/dionnesaunders/.rvm/config/packages does not exist.    
    /Users/dionnesaunders/.rvm/scripts/functions/build: line 19: /usr/bin/gcc-4.2: No such file or directory
    Installing Ruby from source to: /Users/dionnesaunders/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...   
    ruby-1.9.3-p0 - #fetching 
    ruby-1.9.3-p0 - #extracted to /Users/dionnesaunders/.rvm/src/ruby-1.9.3-p0 (already extracted)
    ruby-1.9.3-p0 - #configuring 
    ERROR: Error running ' ./configure --prefix=/Users/dionnesaunders/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/dionnesaunders/.rvm/usr ', please read /Users/dionnesaunders/.rvm/log/ruby-1.9.3-p0/configure.log
    ERROR: There has been an error while running configure. Halting the installation.
    14:20:14: ~/.rvm/config $ 
    

    configure.log output

    14:20:14: ~/.rvm/config $ 
    cat ~/.rvm/log/ruby-1.9.3-p0/configure.log 
    [2012-01-11 14:20:12]  ./configure --prefix=/Users/dionnesaunders/.rvm/rubies/ruby-    1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml --with-opt-    dir=/Users/dionnesaunders/.rvm/usr 
    configure: WARNING: unrecognized options: --with-libyaml
    checking build system type... i386-apple-darwin11.2.0
    checking host system type... i386-apple-darwin11.2.0
    checking target system type... i386-apple-darwin11.2.0
    checking whether the C compiler works... no
    configure: error: in `/Users/dionnesaunders/.rvm/src/ruby-1.9.3-p0':
    configure: error: C compiler cannot create executables
    
    See `config.log' 
    
    for more details
    14:27:45: ~/.rvm/config $ 
    

    make.log output

    cat ~/.rvm/log/ruby-1.9.3-p0/yaml/make.log
    [2012-01-11 14:20:12] make 
    make: *** No targets specified and no makefile found.  Stop.
    

    Specs and short summary of steps I have taken MacBook Air 13-inch, Mid 2011 Software Mac OS X Lion 10.7.2 (11C74)

    • Installed RVM
    • Tried to install ruby via rvm
    • Figured there may be an xcode / gcc compiler problem, so installed xcode from app store
    • Tried again to install ruby via rvm, failed
    • Tried to reinstall xcode incase the installation didn't complete properly
    • Exported GCC to path as suggested by someone who experienced a similar problem
    • Tried again to install ruby via rvm, failed

    If anyone has any suggestions I'd be grateful.

    Thanks guys.

    *edit: *

    GCC -v

    15:15:32: ~ $ 
      gcc -v
    Using built-in specs.
    Target: i686-apple-darwin11
    Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
    15:15:51: ~ $ 
    

    extract.log output

    15:15:25: ~ $ 
      cat ~/.rvm/log/ruby-1.9.3-p0/yaml/extract.log
    [2012-01-11 15:14:56] tar mzxf /Users/dionnesaunders/.rvm/archives/yaml-0.1.4.tar.gz -C /Users/dionnesaunders/.rvm/src 
    yaml-0.1.4/tests/example-reformatter-alt.c: Can't unlink already-existing object
    yaml-0.1.4/tests/example-deconstructor.c: Can't unlink already-existing object
    yaml-0.1.4/tests/test-reader.c: Can't unlink already-existing object
    yaml-0.1.4/tests/Makefile.am: Can't unlink already-existing object
    yaml-0.1.4/tests/test-version.c: Can't unlink already-existing object
    yaml-0.1.4/tests/run-dumper.c: Can't unlink already-existing object
    yaml-0.1.4/tests/run-emitter.c: Can't unlink already-existing object
    yaml-0.1.4/tests/run-parser.c: Can't unlink already-existing object
    yaml-0.1.4/tests/run-scanner.c: Can't unlink already-existing object
    yaml-0.1.4/tests/run-loader.c: Can't unlink already-existing object
    yaml-0.1.4/tests/Makefile.in: Can't unlink already-existing object
    yaml-0.1.4/tests/example-reformatter.c: Can't unlink already-existing object
    yaml-0.1.4/tests/example-deconstructor-alt.c: Can't unlink already-existing object
    yaml-0.1.4/config.h.in: Can't unlink already-existing object
    yaml-0.1.4/aclocal.m4: Can't unlink already-existing object
    yaml-0.1.4/Makefile.am: Can't unlink already-existing object
    yaml-0.1.4/configure: Can't unlink already-existing object
    yaml-0.1.4/yaml-0.1.pc.in: Can't unlink already-existing object
    yaml-0.1.4/LICENSE: Can't unlink already-existing object
    yaml-0.1.4/README: Can't unlink already-existing object
    yaml-0.1.4/include/Makefile.am: Can't unlink already-existing object
    yaml-0.1.4/include/yaml.h: Can't unlink already-existing object
    yaml-0.1.4/include/Makefile.in: Can't unlink already-existing object
    yaml-0.1.4/Makefile.in: Can't unlink already-existing object
    yaml-0.1.4/configure.ac: Can't unlink already-existing object
    yaml-0.1.4/config/ltmain.sh: Can't unlink already-existing object
    yaml-0.1.4/config/config.sub: Can't unlink already-existing object
    yaml-0.1.4/config/missing: Can't unlink already-existing object
    yaml-0.1.4/config/config.guess: Can't unlink already-existing object
    yaml-0.1.4/config/install-sh: Can't unlink already-existing object
    yaml-0.1.4/config/depcomp: Can't unlink already-existing object
    yaml-0.1.4/doc/doxygen.cfg: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x6c.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x74.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/doxygen.css: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x69.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x6f.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__event__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/files.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/tab_h.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x74.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x72.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__tokens.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x64.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__emitter.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/bc_s.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x77.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x6b.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__parser__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x62.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x76.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x66.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x72.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/index.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x63.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__mark__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__alias__data__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/closed.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__version.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x75.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/annotated.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x64.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__document__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/modules.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x65.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x6d.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x6d.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/tabs.css: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals_enum.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x71.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x63.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__tag__directive__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/classes.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x77.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x68.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x6b.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x71.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/doxygen.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/open.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x70.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/yaml_8h.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__node__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x75.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x68.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/tab_a.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x73.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/nav_f.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x73.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/tab_s.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals_eval.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x69.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__token__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x65.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x62.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__nodes.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__emitter__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__export.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x6e.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__parser.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals_type.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x6f.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x76.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals_defs.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__node__pair__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x6e.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__events.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x66.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_0x6c.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/globals_func.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/tab_b.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/nav_h.png: Can't unlink already-existing object
    yaml-0.1.4/doc/html/functions_vars_0x70.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__basic.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__simple__key__s.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/group__styles.html: Can't unlink already-existing object
    yaml-0.1.4/doc/html/structyaml__version__directive__s.html: Can't unlink already-existing object
    yaml-0.1.4/src/parser.c: Can't unlink already-existing object
    yaml-0.1.4/src/reader.c: Can't unlink already-existing object
    yaml-0.1.4/src/Makefile.am: Can't unlink already-existing object
    yaml-0.1.4/src/emitter.c: Can't unlink already-existing object
    yaml-0.1.4/src/writer.c: Can't unlink already-existing object
    yaml-0.1.4/src/api.c: Can't unlink already-existing object
    yaml-0.1.4/src/dumper.c: Can't unlink already-existing object
    yaml-0.1.4/src/Makefile.in: Can't unlink already-existing object
    yaml-0.1.4/src/yaml_private.h: Can't unlink already-existing object
    yaml-0.1.4/src/scanner.c: Can't unlink already-existing object
    yaml-0.1.4/src/loader.c: Can't unlink already-existing object
    yaml-0.1.4/win32/Makefile.am: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/example_deconstructor_alt.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/run_scanner.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/example_reformatter_alt.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/test_reader.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/example_deconstructor.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/run_dumper.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/libyaml.sln: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/run_parser.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/yaml.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/test_version.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/run_emitter.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/example_reformatter.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/run_loader.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2003/yamldll.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/run_emitter.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/run_dumper.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/example_deconstructor_alt.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/yaml.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/run_parser.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/example_deconstructor.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/example_reformatter_alt.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/run_scanner.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/run_loader.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/test_reader.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/libyaml.dsw: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/example_reformatter.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/yamldll.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/vc6/test_version.dsp: Can't unlink already-existing object
    yaml-0.1.4/win32/Makefile.in: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/example_deconstructor_alt.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/run_scanner.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/example_reformatter_alt.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/test_reader.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/example_deconstructor.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/run_dumper.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/libyaml.sln: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/run_parser.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/yaml.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/test_version.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/run_emitter.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/example_reformatter.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/run_loader.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/vs2008/yamldll.vcproj: Can't unlink already-existing object
    yaml-0.1.4/win32/config.h: Can't unlink already-existing object
    tar: Error exit delayed from previous errors.
    
  • VivekVarade123
    VivekVarade123 over 12 years
    did you use rvm pkg install libyaml
  • Très
    Très over 12 years
    oh no I didn't. I used brew I think. However, when I try via rvm it errors as well.
  • Très
    Très over 12 years
    I've just tried installing readline, it was successfully installed but did not solve any ruby installation issues unfortunately. thanks for the tip though
  • VivekVarade123
    VivekVarade123 over 12 years
    after installing your packages. Uninstall all of the versions of ruby and then install them again
  • Très
    Très over 12 years
    yeah I did try this, I found that it has helped other people (google) sadly it didn't solve my issue. thanks though.
  • Très
    Très over 12 years
    there were no versions of Ruby installed to uninstall. This is a fresh machine and installing via RVM was my first attempt.
  • Matej
    Matej about 12 years
    If you have XCode from AppStore then you need to change the command to 'export CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc && rvm install 1.8.7'
  • Bijan
    Bijan about 12 years
    I ran into this same issue while trying to install 1.9.3-p194 and it took me hours to work through it. This answer helped a lot, and so did this link: moncefbelyamani.com/…. What finally worked for me was to go through all this BS and then go into the .rvm/archives folder and remove the ruby-1.9.3-p194.tar.bz2 before trying the installation again. I'm definitely checking out rbenv the next time I have to go through something like this.
  • Kiddo
    Kiddo almost 12 years
    i had following issues:clang: error: unsupported option '--with-libyaml' Ruby 'ruby-1.9.3-p194' was built using clang - but it's not (fully) supported, expect errors.
  • Très
    Très almost 12 years
    I actually haven't encountered any subsequent errors once I had installed it with clang.
  • chaostheory
    chaostheory over 11 years
    It's buggy for me. I can't even run bundler without running into an error.
  • Très
    Très over 11 years
    It may be possible that there are differences between our environments. I am still yet to experience anything strange. Out of interest, which OS are you running?
  • Peter Ehrlich
    Peter Ehrlich about 11 years
    rvm implode and then reinstalling did it for me, after swapping my hard drive in to a new macbook. Also I updated xcode dev tools and did brew install apple-gcc42 beforehand, don't know if they had any effect.
  • Matt Huggins
    Matt Huggins over 10 years
    Thank you, this was the correct answer for me. Not sure why installing the command line tools is so contrived!
  • satoukum
    satoukum about 9 years
    Another way to install the xcode command line tools is to use: xcode-select --install