rails bundle安装错误therubyracer



我尝试分别安装gem和v8文件。我不知道该怎么办,因为我已经用尽了所有可能的选择

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/giowong/.rbenv/versions/2.1.3/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
 Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/giowong/.rbenv/versions/2.1.3/bin/ruby
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--without-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of   
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location
thanks,
The Mgmt
from     /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in   /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to   /Users/giowong/rails_project/doctible_pre_treatment/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.out
An error occurred while installing therubyracer (0.12.1), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling.

我正在使用brew安装ruby和rails,使用这个设置指南

https://gorails.com/setup/osx/10.10-yosemite

请帮忙,升级到Yosemite完全打乱了我的开发环境

也许这个问题与XCode最近的更新有关。XCode更新后,您需要执行以下步骤:

  1. 打开Xcode并接受许可协议
  2. 重新安装命令行工具

第二步似乎取决于您的操作系统版本。如果xcode-select --install不工作,请尝试在/System/Library/CoreServices中启动Install Command Line Developer Tools应用程序。

重新安装命令行工具后,请尝试重新运行bundle install

试试这个对我有用:

gem install libv8 -- --with-system-v8

gem install therubyracer -v '0.12.1'

如果不起作用,尝试运行:

brew update

然后重试前两步。

我通过更改Gemfile 解决了同样的问题

gem 'therubyracer'

被取代

gem 'therubyracer', platforms: :ruby

你能试试这个吗?

这适用于Catalina

 brew install v8@3.15
 gem install libv8 -v 3.16.14.19 -- --with-system-v8
 gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

最新更新