gpt4 book ai didi

ruby-on-rails - 我无法在 Arch Linux x64 中安装 therubyracer

转载 作者:数据小太阳 更新时间:2023-10-29 07:44:16 26 4
gpt4 key购买 nike

当我尝试安装 therubyracer 时,出现以下错误:

Installing therubyracer (0.11.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/home/carlos/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for v8.h... yes
creating Makefile

make
compiling script.cc
compiling v8.cc
compiling backref.cc
compiling value.cc
compiling accessor.cc
compiling trycatch.cc
compiling primitive.cc
compiling external.cc
compiling date.cc
compiling exception.cc
compiling init.cc
compiling template.cc
compiling message.cc
compiling stack.cc
compiling gc.cc
compiling string.cc
compiling handles.cc
compiling function.cc
compiling heap.cc
compiling invocation.cc
compiling locker.cc
compiling object.cc
compiling array.cc
compiling constants.cc
compiling rr.cc
compiling signature.cc
compiling constraints.cc
compiling context.cc
context.cc: In static member function ‘static VALUE rr::Context::SetData(VALUE, VALUE)’:
context.cc:81:3: error: no matching function for call to ‘v8::Context::SetData(rr::String)’
context.cc:81:3: note: candidate is:
In file included from rr.h:4:0,
from context.cc:1:
/usr/include/v8.h:3721:8: note: void v8::Context::SetData(v8::Handle<v8::Value>)
/usr/include/v8.h:3721:8: note: no known conversion for argument 1 from ‘rr::String’ to ‘v8::Handle<v8::Value>’
make: *** [context.o] Error 1


Gem files will remain installed in /home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0 for inspection.
Results logged to /home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.11.0), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.11.0'` succeeds before bundling.

我不知道发生了什么。

最佳答案

实际上,这有点棘手。

我使用我的习惯 dotfiles ,所以,我的 PATH 中有 ~/.dotfiles/bin

我也是been noticed that the issue is related to python v3 vs v2 .

因此,修复非常简单,不会破坏我的系统:

ln -s /usr/bin/python2 ~/.dotfiles/bin
reload
gem install libv8 --verbose
bundle

像这样保留我的Gemfile:

[...]
gem 'therubyracer', :require => 'v8', :platforms => :ruby
[...]

然后 BOOM,它成功了。

谢谢大家的帮助。很抱歉延迟回复。

干杯


编辑

问题已在较新的 therubyracer 版本 (0.11.1) 中得到修复。

关于ruby-on-rails - 我无法在 Arch Linux x64 中安装 therubyracer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13999070/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com