rails bundle安装错误therubyracer

时间:2014-11-08 00:25:58

标签: ruby-on-rails ruby

我尝试单独安装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

请帮助,升级到优胜美地已经完全搞砸了我的开发环境

4 个答案:

答案 0 :(得分:0)

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

  1. 打开Xcode并接受许可协议
  2. 重新安装命令行工具。
  3. 第二步似乎取决于您的操作系统版本。如果xcode-select --install不起作用,请尝试在Install Command Line Developer Tools中启动/System/Library/CoreServices应用。

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

答案 1 :(得分:0)

试试这个对我有用:

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

gem install therubyracer -v '0.12.1'

如果没有工作尝试运行:

brew update

再试一下前两步。

答案 2 :(得分:0)

我通过更改Gemfile

解决了同样的问题
gem 'therubyracer'

取代
gem 'therubyracer', platforms: :ruby

你可以尝试一下吗?

答案 3 :(得分:0)

这为卡塔琳娜州效力

 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

Source