我在使用FreeBSD 10上的RVM编译Ruby 1.8.6时遇到问题。如何解决这个问题?
命令运行
安装日志和错误:
[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 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
答案 0 :(得分:1)
我通过pkg install gcc
安装了gcc47,现在它运行时
rvm install 1.8.6 --with-gcc=gcc47
。