Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 我能';t在Arch Linux x64中安装Rubyracer_Ruby On Rails_Ruby_Rbenv_Therubyracer - Fatal编程技术网

Ruby on rails 我能';t在Arch Linux x64中安装Rubyracer

Ruby on rails 我能';t在Arch Linux x64中安装Rubyracer,ruby-on-rails,ruby,rbenv,therubyracer,Ruby On Rails,Ruby,Rbenv,Therubyracer,当我尝试安装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

当我尝试安装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.
安装带有本机扩展的therubyracer(0.11.0)
Gem::Installer::ExtensionBuildError:错误:无法生成Gem本机扩展。
/home/carlos/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb
正在-lpthread中检查main()。。。对
正在检查v8.h。。。对
创建Makefile
制作
编译script.cc
编译v8.cc
编译backref.cc
编译value.cc
编译accessor.cc
编译trycatch.cc
编译primitive.cc
编译external.cc
编译日期.cc
编译exception.cc
编译init.cc
编译template.cc
编译message.cc
编译stack.cc
编译gc.cc
编译string.cc
编译handles.cc
编译function.cc
编译heap.cc
编译invocation.cc
编译locker.cc
编译object.cc
编译array.cc
编译常量.cc
编译rr.cc
编译signature.cc
编译constraints.cc
编译context.cc
context.cc:在静态成员函数“static VALUE rr::context::SetData(VALUE,VALUE)”中:
context.cc:81:3:错误:调用“v8::context::SetData(rr::String)”时没有匹配的函数
上下文。抄送:81:3:注:候选人是:
在rr.h:4:0中包含的文件中,
来自上下文。cc:1:
/usr/include/v8.h:3721:8:注意:void v8::Context::SetData(v8::Handle)
/usr/include/v8.h:3721:8:注意:参数1没有从'rr::String'到'v8::Handle'的已知转换
生成:**[context.o]错误1
Gem文件仍将安装在/home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0中以供检查。
结果记录到/home/carlos/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/therubyracer-0.11.0/ext/v8/gem_make.out
安装therubyracer(0.11.0)时出错,捆绑程序无法继续。
在绑定之前,请确保'gem install therubyracer-v'0.11.0'成功。

我不知道发生了什么。

您需要安装libv8 3.11.x才能获得最新版本的therubyracer。
因此,请尝试更新libv8,然后进行捆绑。

我的ArchLinux中也存在同样的问题。这是一个很好的例子。在archlinux上为my工作的变通方法是通过在
Gemfile
中添加以下行锁定到
0.10.2

gem 'therubyracer', '0.10.2', :platforms => :ruby

我已经测试过了&它至少可以在64位上工作。希望它也能对您起作用。

我强烈建议您使用external Node.js(我确信有一个官方的软件包)然后使用


如果您使用的是Rails,它已经依赖于,因此您可以删除对RubyRacer的依赖,捆绑、安装Node.js,然后就可以开始了

事实上,这有点棘手

我使用我的自定义,因此,我的路径中有
~/.dotfiles/bin

我也是

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

ln -s /usr/bin/python2 ~/.dotfiles/bin
reload
gem install libv8 --verbose
bundle
将我的
Gemfile
如下所示:

[...]
gem 'therubyracer', :require => 'v8', :platforms => :ruby
[...]
砰的一声,成功了

谢谢你们的帮助。很抱歉延迟回复

干杯


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

可能尝试重新安装v8,因此重新安装Node?相同。现在,我锁定了版本0.10.2,它运行得很好。我使用的是版本0.11.1,仍然需要将python2链接到python,以便编译libv8。我最近格式化了我的整个系统,而对于较新的therubyracer版本,这个问题没有发生。点文件链接中断