2011-08-08 4 views
6

Je courais Lion, en utilisant Xcode 4, ont RVM et homebrew installé mais je suis seulement capable d'exécuter Ruby 1.8.7Problème installation Ruby 1.9.2 sur Mac OS Lion

 
    spurvis:~ rogue$ ruby -v 
    ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0] 
    spurvis:~ rogue$ 

J'ai lu plusieurs les discussions liées à ce sujet, mais rien ne semble fonctionner pour mon problème:

 
    spurvis:~ rogue$ rvm install 1.9.2 
    Installing Ruby from source to: /Users/rogue/.rvm/rubies/ruby-1.9.2-p290, this may take a  while depending on your cpu(s)... 

    ruby-1.9.2-p290 - #fetching 
    ruby-1.9.2-p290 - #extracted to /Users/rogue/.rvm/src/ruby-1.9.2-p290 (already extracted) 
    Fetching yaml-0.1.4.tar.gz to /Users/rogue/.rvm/archives 
    Extracting yaml-0.1.4.tar.gz to /Users/rogue/.rvm/src 
    Configuring yaml in /Users/rogue/.rvm/src/yaml-0.1.4. 
    Compiling yaml in /Users/rogue/.rvm/src/yaml-0.1.4. 
    Installing yaml to /Users/rogue/.rvm/usr 
    ruby-1.9.2-p290 - #configuring 
    ruby-1.9.2-p290 - #compiling 
    ERROR: Error running 'make ', please read /Users/rogue/.rvm/log/ruby-1.9.2-p290/make.log 
    ERROR: There has been an error while running make. Halting the installation. 

le make.log me donne les informations suivantes:

 
    [2011-08-08 11:50:52] make 
    /usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initial 
    rbconfig.rb unchanged 
    ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./enc/make_encmake.rb -- builtin-encs="ascii.o us_ascii.o unicode.o utf_8. 
    ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb -I. ./tool/compile_prelude.rb  ./prelude.rb ./enc/prelude.rb ./gem_prelude 
    /usr/bin/gcc-4.2 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initial 
    ar rcu libruby.1.9.1-static.a dln.o encoding.o version.o array.o bignum.o class.o compar.o  complex.o dir.o dln_find.o enum.o enumera 
    /usr/bin/gcc-4.2 -dynamiclib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/r 
    : -w -L 'Init_*' -L '*_threadptr_*' libruby.1.9.1.dylib 
    ./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/generic_erb.rb -c -o encdb.h ./template/encdb.h.tmpl ./enc enc 
    encdb.h unchanged 
    make -f enc.mk RUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb " MINIRUBY="./miniruby -I./lib -I.ext/common -I./- -r 
    make[1]: Nothing to be done for `enc'. 
    make -f enc.mk RUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb " MINIRUBY="./miniruby -I./lib -I.ext/common -I./- -r 
    make[1]: Nothing to be done for `srcs'. 
./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb ./tool/generic_erb.rb -c -o transdb.h ./template/transdb.h.tmpl ./enc/tra 
    transdb.h unchanged 
    make -f enc.mk RUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb " MINIRUBY="./miniruby -I./lib -I.ext/common -I./- -r 
    make[1]: Nothing to be done for `./enc/trans'. 
make -f enc.mk RUBY="./miniruby -I./lib -I.ext/common -I./- -r./ext/purelib.rb " MINIRUBY="./miniruby -I./lib -I.ext/common -I./- -r 
    mkdir -p .ext/x86_64-darwin11.0.0/enc .ext/x86_64-darwin11.0.0/enc/trans enc enc/trans 
    compiling -test-/bug-3662 
    make[1]: Nothing to be done for `all'. 
    compiling -test-/string 
    make[1]: Nothing to be done for `all'. 
    compiling bigdecimal 
    make[1]: Nothing to be done for `all'. 
    compiling continuation 
    make[1]: Nothing to be done for `all'. 
    compiling coverage 
    make[1]: Nothing to be done for `all'. 
    compiling curses 
    
    compiling openssl 
    /usr/bin/gcc-4.2 -I. -I../../.ext/include/x86_64-darwin11.0.0 -I../.././include - I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" 
    ossl_bio.c: In function ‘ossl_obj2bio’: 
    ossl_bio.c:26: error: called object ‘".rnd"’ is not a function 
    ossl_bio.c:42: warning: implicit conversion shortens 64-bit value into a 32-bit value 
    make[1]: *** [ossl_bio.o] Error 1 
    make: *** [mkmain.sh] Error 1 

Par d'autres suggestions j'ai essayé d'ajouter CC =/usr/bin/gcc-4.2 à mon bashrc mais cela n'a pas résolu le problème non plus.

Aidez s'il vous plaît!

+0

Essayez l'installation de RVM 1.9.2 --with-gcc = clang par http://stackoverflow.com/questions/8032824/cant-install-ruby-under-lion-with-rvm-gcc-issues –

Répondre

5

Assurez-vous que vous avez la dernière Xcode disponible (vous aurez besoin de le mettre à jour si vous utilisez une copie de léopard des neiges. Mise à jour RVM rvm get head puis essayez à nouveau.

j'avais des problèmes de compilation REE mais 1,9 .2 a bien fonctionné, vous pouvez essayer d'ajouter cette fonction à .profile dans votre répertoire, il va compiler avec gcc (au lieu de la valeur par défaut LLVM)

# using_gcc for 64btt compiling on lion (solves compatability issues) 
function using_gcc() { 
    env CC="/usr/bin/gcc-4.2" ARCHFLAGS="-arch x86_64" ARCHS="x86_64" $* 
} 

Ensuite, exécutez using_gcc rvm install 1.9.2

+0

Ceci a fonctionné pour moi. Vous pouvez voir si le compilateur est le problème dans .rvm/log/make.log (le mien avait un Segfault). 'CC ="/usr/bin/gcc-4.2 "ARCHFLAGS =" - arch x86_64 "ARCHS =" x86_64 "rvm install 1.9.2' –

0

Si vous voulez obtenir rvm install ree avec Ruby 1.8.7 au travail, ce a résolu le problème pour moi:

# using_gcc for 32btt compiling on lion (solves compatability issues) 
function using_gcc() { 
    env CC="/usr/bin/gcc-4.2" ARCHFLAGS="-arch x86_32" ARCHS="x86_32" $* 
} 

#then 

using_gcc rvm install ree 

Fondamentalement changeant juste dans l'autre réponse « 64 » à « 32 ».

1

Si vous utilisez une nouvelle copie de Lion & Xcode 4.2, vous devez d'abord installer le GCC 4.2 dev libraries en premier - ils ne sont pas inclus dans une nouvelle installation de Xcode 4.2.

Passez ensuite le drapeau CC="/usr/bin/gcc-4.2" lors de l'installation de votre rvm.

Assurez-vous de rvm remove toute tentative d'installation précédente en premier.

Questions connexes