加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 捆绑安装/在rails上安装libv8(3.3.10.4)时发生

发布时间:2020-12-16 19:47:17 所属栏目:百科 来源:网络整理
导读:我在宝石文件中添加了宝石“sunspot_rails”,并运行捆绑安装.我在安装libv8时收到错误,错误信息如下: Installing libv8 (3.3.10.4) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /opt/local
我在宝石文件中添加了宝石“sunspot_rails”,并运行捆绑安装.我在安装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安装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?

解决方法

强制extconf.rb文件在安装时需要rubygems:
RUBYOPT=-rrubygems gem install libv8 -v '3.3.10.4'

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读