Mountain Lion rvm install 1.8.7 x11 error

后端 未结 5 833
醉梦人生
醉梦人生 2020-12-02 04:55

After update to Mountain Lion, I tried install 1.8.7, and I got error. X11 file not found, I installed Xquarkz, but nothing changed. Whats wrong?

Fail to fi         


        
相关标签:
5条回答
  • 2020-12-02 05:21

    Try to install X11 via http://xquartz.macosforge.org/landing/ set the correct path to the X11 library for the compiler with:

    export CPPFLAGS=-I/opt/X11/include
    

    then try to reinstall ruby, passing to the compiler where gcc-4.2 is:

    CC=/usr/local/bin/gcc-4.2 rvm reinstall 1.8.7
    

    Without CC I got a lot of segmentation faults.

    0 讨论(0)
  • 2020-12-02 05:25

    I managed to do following on OSX 10.8.2 without a problem:

    rvm install 1.8.7 --with-gcc=clang --without-tcl --without-tk
    
    0 讨论(0)
  • 2020-12-02 05:26

    If you don't need tcl or tk and are using rbenv, this should work:

    brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
    
    CC=/usr/local/bin/gcc-4.2 CONFIGURE_OPTS="--without-tcl --without-tk" rbenv install 1.8.7-p358
    
    0 讨论(0)
  • 2020-12-02 05:40

    Here's my .rvmrc bootstrap file for now, hope it helps:

    if (uname -a | grep '12.0.0 Darwin' >/dev/null); then
        CC=/usr/local/bin/gcc-4.2 CPPFLAGS=-I/opt/X11/include rvm --install --create --disable-tcl --disable-tk use ree@gemset_name
    else
        rvm --install --create --disable-tcl --disable-tk use ree@gemset_name
    fi
    
    if ! which bundle >/dev/null; then
        gem install bundler --pre --no-ri --no-rdoc && bundle install
    fi
    
    
    if ! bundle check >/dev/null; then
        bundle install
    fi
    
    0 讨论(0)
  • 2020-12-02 05:42

    Even after the X11 fix I was getting this compile error.

    compiling stubs.c
    In file included from stubs.c:16:
    /usr/include/tk.h:23:3: error: #error Tk 8.5 must be compiled with tcl.h from Tcl 8.5
    make[2]: *** [stubs.o] Error 1
    make[1]: *** [ext/tk/all] Error 2
    make: *** [build-ext] Error 2
    

    After much head scratching I noticed this line in the make output.

    Use ActiveTcl libraries (if available).
    

    Turns out I had ActiveTcl 8.4 installed installed years ago, but it was picking up tk.h from /usr/include which is version 8.5.

    I couldn't figure out how to safely uninstall ActiveTcl and the ActiveTcl uninstall instructions weren't correct, but I did install ActiveTcl 8.5 and that worked around the issue. ActiveTcl Download here.

    Frustrating. Anyway hope this helps someone else.

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