MAC:extconf失败,退出代码1

时间:2019-04-14 16:24:41

标签: mysql ruby ruby-on-rails-4 rubygems

我无法安装捆绑的mysql2,我已经尝试了在这里以及在www上其他地方找到的所有内容。

xcode是最新的。 安装了MySQL 8.0.15 Mac OS X 10.12.6 Ruby 2.3.0 滑轨4 宝石1.9.3 家酿 功放

这是怎么回事: '''''''''

sudo bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.2
Following files may not be writable, so sudo is needed:
  /usr/bin
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Using minitest 4.7.5
Using multi_json 1.13.1
Using thread_safe 0.3.6
Using tzinfo 0.3.55
Using activesupport 4.0.0
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.5
Using rack-test 0.6.3
Using actionpack 4.0.0
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.5
Using actionmailer 4.0.0
Using activemodel 4.0.0
Using activerecord-deprecated_finders 1.0.4
Using arel 4.0.2
Using activerecord 4.0.0
Using bundler 1.17.3
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using coffee-script 2.4.1
Using thor 0.20.3
Using railties 4.0.0
Using coffee-rails 4.0.1
Using hike 1.2.3
Using jbuilder 1.5.3
Using jquery-rails 3.1.5
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/bundler20190414-11509-1m71ivpmysql2-0.5.2/gems/mysql2-0.5.2/ext/mysql2
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -I /Library/Ruby/Site/2.3.0 -r ./siteconf20190414-11509-1ibarkq.rb extconf.rb
checking for rb_absint_size()... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:535:in `block in try_link0'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:532:in `try_link0'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1051:in `block in have_func'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:1050:in `have_func'
    from extconf.rb:25:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/bundler20190414-11509-1m71ivpmysql2-0.5.2/extensions/universal-darwin-16/2.3.0/mysql2-0.5.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/bundler20190414-11509-1m71ivpmysql2-0.5.2/gems/mysql2-0.5.2 for inspection.
Results logged to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/bundler20190414-11509-1m71ivpmysql2-0.5.2/extensions/universal-darwin-16/2.3.0/mysql2-0.5.2/gem_make.out

An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  mysql2

然后我看mkmf,这根本没有给我任何线索。至少对我来说。 我为RoR弄得一团糟...

这是mkmf.log所说的。

"clang -o conftest -I/Applications/MAMP/Library/include/ruby-2.3.0/x86_64-darwin13 -I/Applications/MAMP/Library/include/ruby-2.3.0/ruby/backward -I/Applications/MAMP/Library/include/ruby-2.3.0 -I. -I/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/include -I/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/include/libxml2 -I/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/include/libxml2 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   "-DNOKOGIRI_LIBXML2_PATH=\"/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4\"" "-DNOKOGIRI_LIBXML2_PATCHES=\"\"" "-DNOKOGIRI_LIBXSLT_PATH=\"/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29\"" "-DNOKOGIRI_LIBXSLT_PATCHES=\"\"" -pipe -arch x86_64 -DNOKOGIRI_USE_PACKAGED_LIBRARIES conftest.c  -L. -L/Applications/MAMP/Library/lib -L/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/lib -L/Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/lib -L/Applications/MAMP/Library/lib -L. -fstack-protector    /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/lib/libexslt.a -lm -liconv -lpthread -lz /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/lib/libxml2.a /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/lib/libxslt.a -lm -liconv -lpthread -lz /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/lib/libxml2.a -llzma -lruby-static -framework CoreFoundation /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/lib/libexslt.a -lm -liconv -lpthread -lz /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/lib/libxml2.a /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxslt/1.1.29/lib/libxslt.a -lm -liconv -lpthread -lz /Applications/MAMP/Library/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0.1/ports/x86_64-apple-darwin13.4.0/libxml2/2.9.4/lib/libxml2.a -llzma -lpthread -ldl -lobjc  "
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: extern void xmlSchemaSetParserStructuredErrors();
14: int t(void) { xmlSchemaSetParserStructuredErrors(); return 0; }
/* end */

--------------------

我想念什么?

0 个答案:

没有答案