therubyracer不会编译

时间:2014-05-31 19:18:19

标签: ruby install x86-64 therubyracer

尝试安装therubyracer时出现此错误:

# gem install therubyracer -v '0.12.1'
Fetching: ref-1.0.5.gem (100%)
Successfully installed ref-1.0.5
Fetching: libv8-3.16.14.3-x86_64-linux.gem (100%)
Successfully installed libv8-3.16.14.3-x86_64-linux
Fetching: therubyracer-0.12.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for main() in -lpthread... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling accessor.cc
compiling array.cc
compiling backref.cc
compiling constants.cc
compiling constraints.cc
compiling context.cc
compiling date.cc
compiling exception.cc
compiling external.cc
compiling function.cc
compiling gc.cc
compiling handles.cc
compiling heap.cc
compiling init.cc
compiling invocation.cc
compiling locker.cc
compiling message.cc
compiling object.cc
compiling primitive.cc
compiling rr.cc
compiling script.cc
compiling signature.cc
compiling stack.cc
compiling string.cc
compiling template.cc
compiling trycatch.cc
compiling v8.cc
compiling value.cc
linking shared-object v8/init.so
g++: error: /usr/local/rvm/gems/ruby-2.1.2@watu/gems/libv8-3.16.14.3-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a: No such file or directory
g++: error: /usr/local/rvm/gems/ruby-2.1.2@watu/gems/libv8-3.16.14.3-x86_64-linux/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a: No such file or directory
make: *** [init.so] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.2@watu/gems/therubyracer-0.12.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.2@watu/extensions/x86_64-linux/2.1.0/therubyracer-0.12.1/gem_make.out

这是在64位服务器上:

# uname -a
Linux einstein 3.14.1-x86_64-linode39 #1 SMP Fri Apr 25 13:07:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

在另一台x86_64服务器上,它安装没有问题。任何想法在这里发生了什么?

1 个答案:

答案 0 :(得分:2)

这是一个从32位内核升级到64位的Linode虚拟服务器。将Linux内核降级为32位解决了这个问题。