使用Ruby 2.6.10和Apple M1芯片安装libv8 8.4.255.0



我正在开发一个Rails(Ruby 2.6.10(应用程序,该应用程序需要libv8,但在尝试bundle install时多次失败。错误如下:

Error: Command 'vpython third_party/depot_tools/update_depot_tools_toggle.py --disable' returned non-zero exit status 1 in
/Users/jackel/.asdf/installs/ruby/2.6.10/lib/ruby/gems/2.6.0/gems/libv8-8.4.255.0/vendor
Running: gclient root
Running: gclient config --spec 'solutions = [
{
"name": "v8",
"url": "https://chromium.googlesource.com/v8/v8.git",
"deps_file": "DEPS",
"managed": False,
"custom_deps": {},
},
]
'

我有点不知道如何修复,因为网上的大多数答案似乎都是针对intel/x86_64芯片的。你知道如何让它正常工作吗?

我刚刚在M1 Macbook Air上安装了libv8,带有:

gem install libv8
Fetching libv8-8.4.255.0-x86_64-darwin-20.gem
Successfully installed libv8-8.4.255.0-x86_64-darwin-20
1 gem installed

我在这个目录中使用Ruby 2.6.6,rbenv作为我的Ruby管理器。正如您所看到的,它正在构建x86版本。这是因为我在Rosetta模式下运行终端,所以它模仿旧的x86架构,直到我需要的所有库都跟上为止。要设置,请转到"应用程序"->实用程序->终端,右键点击终端;获取信息";(命令i(,并选中"罗塞塔"复选框。

最新更新