简体   繁体   English

错误:无法构建本机gem扩展

[英]Error: Failed to build native gem extension

I've tried following some of the advice to uninstall libv8 and reinstall it, then run bundle, but it doesn't seem to work. 我尝试遵循一些建议来卸载libv8并重新安装它,然后运行bundle,但是它似乎不起作用。 I'm trying to install twitter-bootstrap-rails with less. 我正在尝试以更少的方式安装twitter-bootstrap-rails。

> gem install libv8 -v 3.16.14.3 -- --with-system-v8
Done installing documentation for  after 0 seconds
> bundle update
Updating git://github.com/seyhunak/twitter-bootstrap-rails.git
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.3.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.9.2)
Installing thread_safe (0.3.3)
Installing tzinfo (0.3.39)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.2)
Using activemodel (4.0.2)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.2)
Using activerecord (4.0.2)
Using bcrypt (3.1.7)
Using bundler (1.5.2)
Using coffee-script-source (1.7.0)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Installing thor (0.19.1)
Using railties (4.0.2)
Using coffee-rails (4.0.1)
Using orm_adapter (0.5.0)
Using warden (1.2.3)
Installing devise (3.2.4)
Using hike (1.2.3)
Using jbuilder (1.5.3)
Using jquery-rails (3.1.0)
Using json (1.8.1)
Using kaminari (0.15.1)
Using libv8 (3.16.14.3)
Using tilt (1.4.1)
Using sprockets (2.11.0)
Using sprockets-rails (2.0.1)
Using rails (4.0.2)
Using rdoc (4.1.1)
Using ref (1.0.5)
Installing sass (3.2.19)
Installing sass-rails (4.0.3)
Using sdoc (0.4.0)
Using simple_form (3.0.2)
Using sqlite3 (1.3.9)

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling array.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling backref.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling constants.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling constraints.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling context.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling date.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling exception.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling external.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling function.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling gc.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling handles.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling heap.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling init.cc
clang: warning: argument unused during compilation: '-rdynamic'
init.cc:11:20: warning: empty parentheses interpreted as a function declaration [-Wvexing-parse]
    v8::Locker lock();
                   ^~
init.cc:11:20: note: remove parentheses to declare a variable
    v8::Locker lock();
                   ^~
init.cc:11:16: warning: 'lock' has C-linkage specified, but returns user-defined type 'v8::Locker' which is incompatible with C [-Wreturn-type-c-linkage]
    v8::Locker lock();
               ^
2 warnings generated.
compiling invocation.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling locker.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling message.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling object.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling primitive.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling rr.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling script.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling signature.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling stack.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling string.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling template.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling trycatch.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling v8.cc
clang: warning: argument unused during compilation: '-rdynamic'
compiling value.cc
clang: warning: argument unused during compilation: '-rdynamic'
linking shared-object v8/init.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [init.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/****/.bundler/tmp/63501/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/****/.bundler/tmp/63501/extensions/universal-darwin-13/2.0.0/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.

I'm not sure what else to do at this point. 我不确定目前还需要做什么。 Should I try uninstalling the gems and reinstalling them? 我应该尝试卸载gems并重新安装它们吗?

Just had this problem. 刚遇到这个问题。 I am on OSX 10.9.1 Try upgrading your xcode and try bundle install again. 我在OSX 10.9.1上,尝试升级xcode,然后尝试再次安装捆绑软件。

如果您在Windows上工作,则文件less将无法工作。

I found a workaround to the above problem. 我找到了解决上述问题的方法。

This is more of a compatibility among libv8 and therubyracer. 这更像是libv8和therubyracer之间的兼容性。

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

gem install therubyracer -v '0.10.2'

This should work fine as both the versions are compatible with me. 由于两个版本都与我兼容,因此应该可以正常工作。 Initially I was trying to install the version 0.12.0 for therubyracer and was facing the issue. 最初,我试图为therubyracer安装版本0.12.0,并且遇到了问题。 Once I switched to version 0.10.2, everything worked fine. 切换到0.10.2版后,一切正常。

My current OS: Mavericks 我当前的操作系统:小牛

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM