无法安装therubyracer

时间:2016-12-20 08:50:18

标签: ruby-on-rails ruby

我尝试了不同的红宝石,仍然无法安装这个宝石。 Ubuntu 16.10

duke@ostrov:~$ gem install therubyracer -v '0.10.2'
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

    /home/duke/.rvm/rubies/ruby-2.1.8/bin/ruby -r ./siteconf20161220-631-1qvqd0t.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling v8_locker.cpp
v8_locker.cpp: In function ‘VALUE {anonymous}::Lock::Delete(VALUE)’:
v8_locker.cpp:45:5: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
v8_locker.cpp: In function ‘VALUE {anonymous}::Unlock::Delete(VALUE)’:
v8_locker.cpp:85:5: warning: no return statement in function returning non-void [-Wreturn-type]
     }
     ^
compiling v8_weakref.cpp
compiling v8_value.cpp
v8_value.cpp:100:9: warning: ‘VALUE {anonymous}::ToInt32(VALUE)’ defined but not used [-Wunused-function]
   VALUE ToInt32(VALUE self) {
         ^~~~~~~
compiling v8_script.cpp
compiling v8_array.cpp
compiling v8_handle.cpp
compiling v8_try_catch.cpp
v8_try_catch.cpp: In function ‘v8::TryCatch* {anonymous}::unwrap(VALUE)’:
v8_try_catch.cpp:15:14: error: cannot convert ‘bool’ to ‘v8::TryCatch*’ in return
       return false;
              ^~~~~
Makefile:216: ошибка выполнения рецепта для цели «v8_try_catch.o»
make: *** [v8_try_catch.o] Ошибка 1

make failed, exit code 2

Gem files will remain installed in /home/duke/.rvm/gems/ruby-2.1.8/gems/therubyracer-0.10.2 for inspection.
Results logged to /home/duke/.rvm/gems/ruby-2.1.8/extensions/x86_64-linux/2.1.0/therubyracer-0.10.2/gem_make.out

我在相关问题上尝试了其他一些答案,但没有任何帮助。我没有解决方案。

2 个答案:

答案 0 :(得分:0)

此软件包包含Ruby 1.9.1扩展库所需的头文件。您需要通过执行以下操作来安装ruby1.9.1-dev软件包:

sudo apt-get install ruby1.9.1-dev

一般来说,这样做更容易:

sudo apt-get install ruby-dev

答案 1 :(得分:0)

我认为您的问题是libv8,因此您应该通过以下命令卸载libv8

gem uninstall libv8

然后再次运行gem install therubyracer -v '0.10.2'。它会起作用。