tomgi / git_stats

GitStats is a git repository statistics generator.
MIT License
1.08k stars 152 forks source link

gem install fails on macOS High Sierra v10.13.2 #83

Closed ascooper57 closed 6 years ago

ascooper57 commented 6 years ago

Hello,

I have been using git_stats for over a year on various Mac laptops. I tried installing git_stats on my new laptop running macOS High Sierra v10.13.2 and it fails:

sudo gem install git_stats Password: Building native extensions. This could take a while... ERROR: Error installing git_stats: ERROR: Failed to build gem native extension.

current directory: /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri

/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180104-48401-zjew88.rb extconf.rb checking if the C compiler accepts ... yes checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no Building nokogiri using packaged libraries. Using mini_portile version 2.3.0 checking for iconv.h... yes checking for gzdopen() in -lz... yes checking for iconv... yes


IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.5.

Team Nokogiri will keep on doing their best to provide security updates in a timely manner, but if this is a concern for you and want to use the system library instead; abort this installation process and reinstall nokogiri as follows:

gem install nokogiri -- --use-system-libraries
    [--with-xml2-config=/path/to/xml2-config]
    [--with-xslt-config=/path/to/xslt-config]

If you are using Bundler, tell it to use the option:

bundle config build.nokogiri --use-system-libraries
bundle install

Note, however, that nokogiri is not fully compatible with arbitrary versions of libxml2 provided by OS/package vendors.


Extracting libxml2-2.9.5.tar.gz into tmp/x86_64-apple-darwin17/ports/libxml2/2.9.5... OK Running 'configure' for libxml2 2.9.5... OK Running 'compile' for libxml2 2.9.5... ERROR, review '/Library/Ruby/Gems/2.3.0/gems/nokogiri-1.8.1/ext/nokogiri/tmp/x86_64-apple-darwin17/ports/libxml2/2.9.5/compile.log' to see what happened. Last lines are:

CCLD libxml2.la CC testdso.lo CCLD testdso.la CC xmllint.o CCLD xmllint ld: warning: ignoring file /usr/local/Cellar/xz/5.2.3/lib/liblzma.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/Cellar/xz/5.2.3/lib/liblzma.dylib Undefined symbols for architecture i386: "_lzma_auto_decoder", referenced from: _xz_head in libxml2.a(xzlib.o) "_lzma_code", referenced from: _xz_decomp in libxml2.a(xzlib.o) "_lzma_end", referenced from: ___libxml2_xzclose in libxml2.a(xzlib.o) "_lzma_properties_decode", referenced from: _is_format_lzma in libxml2.a(xzlib.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [xmllint] Error 1 make[1]: [all-recursive] Error 1 make: *** [all] Error 2

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) --help --clean --use-system-libraries --enable-static --disable-static --with-zlib-dir --without-zlib-dir --with-zlib-include --without-zlib-include=${zlib-dir}/include --with-zlib-lib --without-zlib-lib=${zlib-dir}/lib --enable-cross-build --disable-cross-build /Library/Ruby/Gems/2.3.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:402:in block in execute': Failed to complete compile task (RuntimeError) from /Library/Ruby/Gems/2.3.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:inchdir' from /Library/Ruby/Gems/2.3.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:373:in execute' from /Library/Ruby/Gems/2.3.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:115:incompile' from /Library/Ruby/Gems/2.3.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:154:in cook' from extconf.rb:365:inblock (2 levels) in process_recipe' from extconf.rb:257:in block in chdir_for_build' from extconf.rb:256:inchdir' from extconf.rb:256:in chdir_for_build' from extconf.rb:364:inblock in process_recipe' from extconf.rb:262:in tap' from extconf.rb:262:inprocess_recipe' from extconf.rb:548:in `

'

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

/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/nokogiri-1.8.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.8.1 for inspection. Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/nokogiri-1.8.1/gem_make.out

senyuuri commented 6 years ago

This seems to be nokogiri's problem. Can you try reinstall it first?

gem install nokogiri -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2/

ascooper57 commented 6 years ago

Hello, I reinstalled via the command above without errors. Then I reinstalled git_stats also without errors. Now I get a runtime error:

$ git_stats --generate /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:2285:in raise_if_conflicts': Unable to activate actionpack-4.2.10, because activesupport-5.1.4 conflicts with activesupport (= 4.2.10) (Gem::ConflictError) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/specification.rb:1408:inactivate' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:196:in rescue in try_activate' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:193:intry_activate' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:125:in rescue in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:inrequire' from /Library/Ruby/Gems/2.3.0/gems/git_stats-1.0.17/lib/git_stats.rb:6:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /Library/Ruby/Gems/2.3.0/gems/git_stats-1.0.17/lib/git_stats/cli.rb:2:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Library/Ruby/Gems/2.3.0/gems/git_stats-1.0.17/bin/git_stats:8:in <top (required)>' from /usr/local/bin/git_stats:22:inload' from /usr/local/bin/git_stats:22:in `

'

ascooper57 commented 6 years ago

I tried: sudo gem install bundler brew install ruby brew link --overwrite ruby

which ruby /usr/local/bin/ruby

ls -lasgF /usr/local/bin/ruby lrwxr-xr-x 1 /usr/local/bin/ruby -> ../Cellar/ruby/2.5.0/bin/ruby

ruby -v ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]

ascooper57 commented 6 years ago

Hello,

I forcefully uninstalled git_stats and reinstalled, git_stats generate now works.

I am closing this issue.

out0fmemory commented 6 years ago

above answer works

ascooper57 commented 6 years ago

Yes everything works now. Thank you

On Sun, Feb 11, 2018 at 6:17 PM out0fmemory notifications@github.com wrote:

above answer works

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/tomgi/git_stats/issues/83#issuecomment-364814557, or mute the thread https://github.com/notifications/unsubscribe-auth/AFoUrZsWSDB_Q_4CuPloWQI6ZwFjLg0zks5tT58bgaJpZM4RTYPf .