You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装therubyracer(0.12.3)失败:系统V8版本未找到兼容问题

解决therubyracer 0.12.3安装失败问题

错误核心信息

home/xxxx/Desktop/dsp-manage/vendor/bundle/ruby/2.7.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in configure': 由于使用了--with-system-v8参数,您选择使用系统中安装的V8版本(而非libv8 RubyGem自带的版本),但触发了Libv8::Location::System::NotFoundError错误。 然而,未能在您的系统中找到V8版本。 请确保安装了与3.16.14.19兼容的系统版V8。若其安装在非标准路径,您可能需要使用--with-v8-dir参数。 该错误来自/home/xxxx/Desktop/dsp-manage/vendor/bundle/ruby/2.7.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in configure_makefile',进而来自extconf.rb:32:in ' 如需查看扩展编译失败的具体原因,请查看以下路径中的mkmf.log文件: /home/xxxx/Desktop/dsp-manage/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/therubyracer-0.12.3/mkmf.log extconf执行失败,退出码1 Gem文件将保留在/home/xxxx/Desktop/dsp-manage/vendor/bundle/ruby/2.7.0/gems/therubyracer-0.12.3路径中以供检查,结果已记录至/home/xxxx/Desktop/dsp-manage/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/therubyracer-0.12.3/gem_make.out 安装therubyracer(0.12.3)时发生错误,Bundler无法继续。请确保执行gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'`命令成功后再进行打包。
Gemfile中包含:therubyracer

解决方案

1. 安装兼容版本的系统V8

针对Debian/Ubuntu发行版,直接安装对应版本的V8库:

sudo apt-get update && sudo apt-get install libv8-3.16.14

RHEL/CentOS等系统需自行编译3.16.14.19版本的V8,或查找第三方源提供的对应包。

2. 指定非标准路径的V8安装

若系统V8安装在自定义路径,安装时通过参数指定路径:

gem install therubyracer -v '0.12.3' --with-v8-dir=/your/custom/v8/path

3. 使用gem自带的V8版本(不依赖系统V8)

取消系统V8依赖,直接安装gem自带版本:

# 单独安装gem
gem install therubyracer -v '0.12.3'

# 通过bundle配置跳过系统V8
bundle config build.libv8 --without-system-v8
bundle install

内容的提问来源于stack exchange,提问作者Mirza Daniyal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 10:05:22