【问题标题】:bundle install / Error in Installing libv8 (3.3.10.4) on rails (running on Lion)bundle install / 在rails上安装libv8(3.3.10.4)时出错(在Lion上运行)
【发布时间】:2012-02-20 14:35:43
【问题描述】:

我在我的 gem 文件中添加了 gem 'sunspot_rails' 并运行了 bundle install。我在安装 libv8 时遇到错误,错误消息如下:

Installing libv8 (3.3.10.4) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /opt/local/bin/ruby extconf.rb 
*** 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
    --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=/opt/local/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...

Gem files will remain installed in /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4 for inspection.
Results logged to /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4/ext/libv8/gem_make.out
An error occured while installing libv8 (3.3.10.4), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.3.10.4'` succeeds before bundling.

当我运行 gem install libv8 -v '3.3.10.4' 时,会打印以下错误消息:

Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
    ERROR: Failed to build gem native extension.

        /opt/local/bin/ruby extconf.rb
*** 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
    --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=/opt/local/bin/ruby
extconf.rb:13: uninitialized constant Gem (NameError)
Checking for Python...

Gem files will remain installed in /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4 for inspection.
Results logged to /Users/sonyakim/.rvm/gems/ruby-1.9.2-p290/gems/libv8-3.3.10.4/ext/libv8/gem_make.out

如何正确安装 libv8?

【问题讨论】:

  • 您使用的是哪个版本的gemgem -v

标签: ruby-on-rails ruby


【解决方案1】:

强制 extconf.rb 文件在安装时需要 ruby​​gems:

RUBYOPT=-rrubygems gem install libv8 -v '3.3.10.4'

在这里找到:https://coderwall.com/p/y1djxq

【讨论】:

    猜你喜欢
    • 2012-05-16
    • 1970-01-01
    • 2018-07-11
    • 2013-05-09
    • 1970-01-01
    • 2012-07-28
    • 2022-11-22
    • 2012-06-23
    • 2012-12-06
    相关资源
    最近更新 更多