我正在尝试使用hombrew在我的Macbook Pro(运行OS X 10.10 beta)上安装metasploit-framework,这样我就可以对我的服务器进行笔试。然而,metasploit在使用ruby 2及更高版本时遇到了很多麻烦(我花了几个小时试图查看是否可以修复metasploit以使其与ruby 2一起工作)所以我想我需要安装ruby 1.9.3。于是,打开了终端并跑了:
rvm install ruby-1.9.3
这是上述命令的输出。请忽略/ - \ |因为这只是rvm在安装时出现在控制台中的旋转动画。
Error running './configure --prefix=/Users/ericmarkmartin/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/ericmarkmartin/.rvm/log/1403754271_ruby-1.9.3-p547/configure.log
[2014-06-25 23:44:47] ./configure
current path: /Users/ericmarkmartin/.rvm/src/ruby-1.9.3-p547
GEM_HOME=/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2
PATH=/Users/ericmarkmartin/.rvm/usr/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2/bin:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2@global/bin:/Users/ericmarkmartin/.rvm/rubies/ruby-2.1.2/bin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/iOSOpenDev/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/ericmarkmartin/.apportable/SDK/bin:/Users/ericmarkmartin/.apportable/SDK/bin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/opt/iOSOpenDev/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/ericmarkmartin/.rvm/bin:/Users/ericmarkmartin/.rvm/bin
GEM_PATH=/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2@global
command(7): ./configure --prefix=/Users/ericmarkmartin/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin14.0.0
checking host system type... i386-apple-darwin14.0.0
checking target system type... i386-apple-darwin14.0.0
checking whether the C compiler works... no
configure: error: in `/Users/ericmarkmartin/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.
经过一番搜索,我发现这是OS X上的一个常见问题,可以使用以下命令解决。
rvm install ruby-1.9.3 --with-gcc=clang
以下是此命令的输出。再次,请忽略/ - \ |字符。
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/ericmarkmartin/.rvm/log/1403754087_ruby-1.9.3-p547/make.log
-- Other runtime information -----------------------------------------------
* Loaded script: ./miniruby
* Loaded features:
0 enumerator.so
[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
++ return 2
There has been an error while running make. Halting the installation.
但是,这会产生错误,说make无法运行。具体来说,它表示在链接miniruby时遇到了分段错误。如果有人可以帮助我在我的Mac上运行1.9.3,我会非常感激,因为我一直在寻找答案而没有找到任何答案。我也已经尝试过安装早期版本的ruby,但同样缺乏成功。下面,我将包含与后两个命令相关联的make日志文件。如果您需要其他日志文件,请通知我,我很乐意提供。
谢谢
make.log里
2014-06-25 00:20:42] __rvm_make
__rvm_make ()
{
\make "$@" || return $?
}
current path: /Users/ericmarkmartin/.rvm/src/ruby-1.9.3-p547
GEM_HOME=/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2
PATH=/Users/ericmarkmartin/.rvm/usr/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/ericmarkmartin/.rbenv/shims:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2/bin:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2@global/bin:/Users/ericmarkmartin/.rvm/rubies/ruby-2.1.2/bin:/Users/ericmarkmartin/.rvm/bin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/iOSOpenDev/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/ericmarkmartin/.apportable/SDK/bin:/Users/ericmarkmartin/.apportable/SDK/bin:/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/opt/iOSOpenDev/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
GEM_PATH=/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2:/Users/ericmarkmartin/.rvm/gems/ruby-2.1.2@global
command(3): __rvm_make -j 1
++ make -j 1
CC = clang
LD = ld
LDSHARED = clang -dynamiclib
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I. -I.ext/include/x86_64-darwin14.0.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/ericmarkmartin/.rvm/rubies/ruby-1.9.3-p547/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-u,_objc_msgSend
SOLIBS =
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling dmyversion.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
bignum.c:897:1: warning: unused function 'next_pow2' [-Wunused-function]
next_pow2(register unsigned long x)
^
1 warning generated.
compiling class.c
compiling compar.c
compiling complex.c
complex.c:78:1: warning: unused function 'f_cmp' [-Wunused-function]
f_cmp(VALUE x, VALUE y)
^
complex.c:108:1: warning: unused function 'f_lt_p' [-Wunused-function]
f_lt_p(VALUE x, VALUE y)
^
complex.c:115:1: warning: unused function 'f_mod' [-Wunused-function]
binop(mod, '%')
^
complex.c:29:21: note: expanded from macro 'binop'
inline static VALUE \
^
<scratch space>:14:1: note: expanded from here
f_mod
^
complex.c:154:1: warning: unused function 'f_abs2' [-Wunused-function]
fun1(abs2)
^
complex.c:36:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:17:1: note: expanded from here
f_abs2
^
complex.c:156:1: warning: unused function 'f_conj' [-Wunused-function]
fun1(conj)
^
complex.c:36:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:21:1: note: expanded from here
f_conj
^
complex.c:158:1: warning: unused function 'f_floor' [-Wunused-function]
fun1(floor)
^
complex.c:36:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:25:1: note: expanded from here
f_floor
^
complex.c:159:1: warning: unused function 'f_imag' [-Wunused-function]
fun1(imag)
^
complex.c:36:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:27:1: note: expanded from here
f_imag
^
complex.c:163:1: warning: unused function 'f_real' [-Wunused-function]
fun1(real)
^
complex.c:36:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:35:1: note: expanded from here
f_real
^
complex.c:184:1: warning: unused function 'f_divmod' [-Wunused-function]
fun2(divmod)
^
complex.c:43:21: note: expanded from macro 'fun2'
inline static VALUE \
^
<scratch space>:43:1: note: expanded from here
f_divmod
^
complex.c:196:1: warning: unused function 'f_idiv' [-Wunused-function]
fun2(idiv)
^
complex.c:43:21: note: expanded from macro 'fun2'
inline static VALUE \
^
<scratch space>:49:1: note: expanded from here
f_idiv
^
complex.c:262:1: warning: unused function 'k_integer_p' [-Wunused-function]
k_integer_p(VALUE x)
^
complex.c:463:1: warning: unused function 'f_complex_new1' [-Wunused-function]
f_complex_new1(VALUE klass, VALUE x)
^
complex.c:518:1: warning: unused function 'm_sqrt_bang' [-Wunused-function]
imp1(sqrt)
^
complex.c:489:21: note: expanded from macro 'imp1'
inline static VALUE \
^
<scratch space>:75:1: note: expanded from here
m_sqrt_bang
^
13 warnings generated.
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
numeric.c:1409:10: warning: 'finite' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
if (!finite(value))
^
/usr/include/math.h:718:12: note: 'finite' has been explicitly marked deprecated here
extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
^
1 warning generated.
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
rational.c:86:1: warning: unused function 'f_gt_p' [-Wunused-function]
f_gt_p(VALUE x, VALUE y)
^
rational.c:136:1: warning: unused function 'f_floor' [-Wunused-function]
fun1(floor)
^
rational.c:40:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:18:1: note: expanded from here
f_floor
^
rational.c:157:1: warning: unused function 'f_truncate' [-Wunused-function]
fun1(truncate)
^
rational.c:40:21: note: expanded from macro 'fun1'
inline static VALUE \
^
<scratch space>:28:1: note: expanded from here
f_truncate
^
rational.c:409:1: warning: unused function 'f_rational_new_bang2' [-Wunused-function]
f_rational_new_bang2(VALUE klass, VALUE x, VALUE y)
^
rational.c:518:1: warning: unused function 'f_rational_new1' [-Wunused-function]
f_rational_new1(VALUE klass, VALUE x)
^
rational.c:533:1: warning: unused function 'f_rational_new_no_reduce1' [-Wunused-function]
f_rational_new_no_reduce1(VALUE klass, VALUE x)
^
6 warnings generated.
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm_dump.c
compiling thread.c
thread.c:2565:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_read);
^~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
thread.c:2566:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_write);
^~~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
thread.c:2567:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized]
rb_fdset_t UNINITIALIZED_VAR(orig_except);
^~~~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
^
3 warnings generated.
compiling cont.c
compiling ./enc/ascii.c
compiling ./enc/us_ascii.c
compiling ./enc/unicode.c
compiling ./enc/utf_8.c
compiling newline.c
compiling ./missing/setproctitle.c
compiling dmyext.c
linking miniruby
./miniruby: [BUG] Segmentation fault
ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-darwin14.0.0]
-- Control frame information -----------------------------------------------
c:0002 p:---- s:0005 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000ae8 d:000ae8 TOP
-- C level backtrace information -------------------------------------------
See Crash Report log file under ~/Library/Logs/CrashReporter or
/Library/Logs/CrashReporter, for the more detail of.
-- Other runtime information -----------------------------------------------
* Loaded script: ./miniruby
* Loaded features:
0 enumerator.so
[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
++ return 2