开发者

help installing Ruby 1.9.2 on Lion GM

开发者 https://www.devze.com 2023-03-17 09:15 出处:网络
Trying to setup Ruby on Rails in my Lion GM dev environment and having some trouble. Installed rvm, and when i try installing ruby i always get an error using rvm install 1.9.2 on my i5 iMAc. It gets

Trying to setup Ruby on Rails in my Lion GM dev environment and having some trouble. Installed rvm, and when i try installing ruby i always get an error using rvm install 1.9.2 on my i5 iMAc. It gets to

ruby-1.9.2-p180 - #compiling

and halts with the following error message:

ERROR: There has been an error while running make. Halting the installation.
update_terminal_cwd; 

in the log i get the following. Im also using Xcode 4.2 for lion. Thanks.


[2011-07-04 12:26:20] make 
gcc -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-lo开发者_JAVA技巧ng  -fno-common -pipe -L.  -Wl,-u,_objc_msgSend   main.o dmydln.o dmyencoding.o dmyversion.o miniprelude.o array.o bignum.o class.o compar.o complex.o dir.o dln_find.o enum.o enumerator.o error.o eval.o load.o proc.o file.o gc.o hash.o inits.o io.o marshal.o math.o node.o numeric.o object.o pack.o parse.o process.o random.o range.o rational.o re.o regcomp.o regenc.o regerror.o regexec.o regparse.o regsyntax.o ruby.o safe.o signal.o sprintf.o st.o strftime.o string.o struct.o time.o transcode.o util.o variable.o compile.o debug.o iseq.o vm.o vm_dump.o thread.o cont.o ascii.o us_ascii.o unicode.o utf_8.o newline.o  dmyext.o -lpthread -ldl -lobjc  -o miniruby
<internal:prelude>: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin11.0.0]

-- control frame ----------
c:0003 p:0000 s:0006 b:0006 l:000005 d:000005 TOP   
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001a68 d:001a68 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
<internal:prelude>:0:in `<compiled>'

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6


I found my answer here, and @Lehi Sanchez is mostly right; Apple is leaving gcc for llvm, but that doesn't mean gcc isn't included in Lion (provided you have the Xcode/Developer Tools package installed). It's at /usr/bin/gcc-4.2. Just include the following in your .bashrc or .zshrc or whatever:

 export CC=/usr/bin/gcc-4.2

Or, I suppose you could fire that line at your shell before you build your 1.9.2 with rvm. In either case, make sure that line is active and then fire your rvm install 1.9.2 and presto!


Mac OS X Lion is not yet released. I've read reports of several bugs in Lion GM (among which even as severe as kernel panics), this is probably also a Lion (or Xcode 4.2) bug, and if not, it's a Ruby bug. RVM is certainly not the cause, as your output indicates the compiled Ruby is crashing.

I would recommend that you wait until Lion is released.

Edit: Now that Lion and Xcode 4.1 is released, I see the issue has been fixed.


I'm running into the same issue. I checked the logs and found the following:

[2011-07-05 20:30:29]  ./configure --prefix=/Users/lsanchez/.rvm/rubies/ruby-1.8.7-p352 --enable-shared --disable-install-doc  
checking build system type... i686-apple-darwin11.0.0
checking host system type... i686-apple-darwin11.0.0
checking target system type... i686-apple-darwin11.0.0
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/lsanchez/.rvm/src/ruby-1.8.7-p352':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

It turns out that Apple is leaving gcc behind for llvm. It looks like they don't even include it in Lion.

0

精彩评论

暂无评论...
验证码 换一张
取 消