【问题标题】:Error while Bundle install捆绑安装时出错
【发布时间】:2017-09-16 04:49:08
【问题描述】:

MAC OS X:我正在使用 bundle install 为我的应用程序安装 gem,但在我的 gem 文件中使用 ruby​​ '1.9.3' ,gem 'rails', '3.2.12' 时出现错误。 .

    Installing gmail_xoauth 0.4.1
    Installing omniauth 1.3.1
    Installing httparty 0.13.7
    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/userx/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r
./siteconf20170420-57041-h8rx0n.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.12
Using compiler: /usr/bin/c++ (clang version 8.1.0)
../src/bignum.cc:761:7: error: variable 'i' is incremented both in the loop
header and in the loop body [-Werror,-Wfor-loop-analysis]
    ++i;
      ^
../src/bignum.cc:756:72: note: incremented here
  for (int i = other.used_digits_ + exponent_diff; i < used_digits_; ++i) {
                                                                       ^
1 error generated.
make[1]: ***
[/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o]
Error 1
make: *** [x64.release] Error 2
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/ext/libv8/location.rb:36:in
`block in verify_installation!': libv8 did not install properly, expected binary
v8 archive
'/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to
exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`each'
from
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/ext/libv8/location.rb:35:in
`verify_installation!'
from
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/ext/libv8/location.rb:26:in
`install!'
    from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=x64 \
-S.x64  -Dv8_enable_backtrace=1
-Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2
-Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror=''
CXX(target)
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target)
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target)
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o

extconf failed, exit code 1

Gem files will remain installed in
/Users/userx/.rvm/gems/ruby-1.9.3-p551/gems/libv8-3.16.14.7 for inspection.
Results logged to
/Users/userx/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-16/1.9.1/libv8-3.16.14.7/gem_make.out

An error occurred while installing libv8 (3.16.14.7), and Bundler
cannot continue.
Make sure that `gem install libv8 -v '3.16.14.7'` succeeds before bundling.
➜  coffeesender git:(sendoso-app) ✗ 

我尝试在错误 gem install libv8 -v '3.16.14.7' 中安装最后一个建议命令 但是另一个错误 安装 libv8 时出错 ERROR: Failed to build gem native extension

【问题讨论】:

  • 运行gem install libv8 -v '3.16.14.7' -- --with-system-v8stackoverflow.com/a/19674065/2675670时会发生什么
  • Fetching: libv8-3.16.14.3.gem (100%) Building native extensions with: '--with-system-v8' This could take a while... Successfully installed libv8-3.16.14.3 1 gem installed 然后我运行 bundle install 并得到同样的错误
  • 尝试按照以下步骤操作,这里:stackoverflow.com/a/25757171/2675670
  • @Richard 我也跟着这个,但同样的错误
  • 你能分享你的 Gemfile 吗?我很难重现该问题。

标签: ruby-on-rails rake bundler


【解决方案1】:

正如之前在 cmets 中的消息,-- --with-system-v8 后缀让捆绑成功:

gem install libv8 -v '3.16.14.7' -- --with-system-v8

【讨论】:

  • 这救了我,谢谢!就像另一个答案所建议的那样运行 gem install libv8 -v '3.16.14.7' 只是不断抛出相同的错误。我不确定你的效果如何,但效果很好。
【解决方案2】:

首先将 gem gem 'libv8', '~> 3.16', '>= 3.16.14.7' 添加到 gem 文件中或运行 gem install libv8 -v 3.16.14.7。

安装或添加 gen 后,运行 bundle install

gem 文件将添加成功。

【讨论】:

    【解决方案3】:

    运行

    gem install httparty -v '0.13.7'

    然后运行

    bundle install

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-15
      • 1970-01-01
      • 2013-08-23
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 2017-07-11
      • 2021-05-25
      相关资源
      最近更新 更多