本文介绍了无法使用RVM编译/安装Ruby 1.8.6(运行'__rvm_make -B -j8'时出错)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在FreeBSD 10上使用RVM编译Ruby 1.8.6时遇到问题.如何解决此问题?

I am having issues compiling Ruby 1.8.6 using RVM on FreeBSD 10. How can I solve this?

命令运行:

  • rvm删除1.8.6(以确保我们开始清理)
  • 启用rvm autolibs
  • rvm install 1.8.6 --with-gcc = clang

安装日志和给出的错误:

[root@sensation ~]# rvm install 1.8.6 --with-gcc=clang
Checking requirements for freebsd.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.8.6-p420, this may take a while depending on your cpu(s)...
ruby-1.8.6-p420 - #downloading ruby-1.8.6-p420, this may take a while depending on your connection...
ruby-1.8.6-p420 - #extracting ruby-1.8.6-p420 to /usr/local/rvm/src/ruby-1.8.6-p420....
ruby-1.8.6-p420 - #applying patch /usr/local/rvm/patches/ruby/1.8.6/openssl-1.0.patch...........
ruby-1.8.6-p420 - #applying patch /usr/local/rvm/patches/ruby/1.8.6/stdout-rouge-fix.patch..
ruby-1.8.6-p420 - #applying patch /usr/local/rvm/patches/ruby/1.8.6/no_sslv2.diff..
ruby-1.8.6-p420 - #applying patch /usr/local/rvm/patches/ruby/1.8.6/syck.patch..
ruby-1.8.6-p420 - #configuring............................
ruby-1.8.6-p420 - #post-configuration.
ruby-1.8.6-p420 - #compiling.........................
Error running '__rvm_make -B -j8',
showing last 15 lines of /usr/local/rvm/log/1404762617_ruby-1.8.6-p420/make.log
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c util.c
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c variable.c
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c version.c
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c dmyext.c
ar rcu libruby-static.a array.o  bignum.o  class.o  compar.o  dir.o  dln.o  enum.o  error.o  eval.o  file.o  gc.o  hash.o  inits.o  io.o  marshal.o  math.o  numeric.o  object.o  pack.o  parse.o  process.o  prec.o  random.o  range.o  re.o  regex.o  ruby.o  signal.o  sprintf.o  st.o  string.o  struct.o  time.o  util.o  variable.o  version.o   dmyext.o
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c main.c
clang -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -rdynamic   main.o  libruby-static.a -lrt -lcrypt -lm   -o miniruby
./lib/fileutils.rb:1471: uninitialized constant OPT_TABLE (NameError)
        from ./mkconfig.rb:10:in `require'
        from ./mkconfig.rb:10
*** Error code 1

Stop.
make: stopped in /usr/local/rvm/src/ruby-1.8.6-p420
++ return 1
There has been an error while running make. Halting the installation.

使用cc(rvm安装1.8.6)时出现相同的错误:

Same error when using cc (rvm install 1.8.6):

Error running '__rvm_make -B -j8',
showing last 15 lines of /usr/local/rvm/log/1404763496_ruby-1.8.6-p420/make.log
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c util.c
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c variable.c
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c version.c
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c dmyext.c
ar rcu libruby-static.a array.o  bignum.o  class.o  compar.o  dir.o  dln.o  enum.o  error.o  eval.o  file.o  gc.o  hash.o  inits.o  io.o  marshal.o  math.o  numeric.o  object.o  pack.o  parse.o  process.o  prec.o  random.o  range.o  re.o  regex.o  ruby.o  signal.o  sprintf.o  st.o  string.o  struct.o  time.o  util.o  variable.o  version.o   dmyext.o
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -I. -I.   -c main.c
cc -O3 -I/usr/local/include  -fPIC  -DRUBY_EXPORT -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -rdynamic   main.o  libruby-static.a -lrt -lcrypt -lm   -o miniruby
./lib/fileutils.rb:1471: uninitialized constant OPT_TABLE (NameError)
        from ./mkconfig.rb:10:in `require'
        from ./mkconfig.rb:10
*** Error code 1

Stop.
make: stopped in /usr/local/rvm/src/ruby-1.8.6-p420
++ return 1

推荐答案

我通过pkg install gcc安装了gcc47,现在我运行时就可以使用

I installed gcc47 via pkg install gccand now it worked when I ran

rvm install 1.8.6 --with-gcc=gcc47.

这篇关于无法使用RVM编译/安装Ruby 1.8.6(运行'__rvm_make -B -j8'时出错)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 07:34