bigcartel / dugway

Easily build and test Big Cartel themes.
https://developers.bigcartel.com/api/themes
MIT License
149 stars 22 forks source link

Unable to install dugway on Mac OS Catalina #187

Closed iam-robin closed 3 years ago

iam-robin commented 3 years ago

OS: Mac OS Catalina installed Ruby Version: ruby 2.6.3p62

When I run gem install dugway I get the following error message:

Building native extensions. This could take a while... ERROR: Error installing dugway: ERROR: Failed to build gem native extension.

current directory: /Library/Ruby/Gems/2.6.0/gems/bigdecimal-1.4.4/ext/bigdecimal

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210212-46246-cqlv8w.rb extconf.rb checking RUBY_BIGDECIMAL_VERSION... 1.4.4 checking for labs() in stdlib.h... 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.6/usr/bin/$(RUBY_BASE_NAME) /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467: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.6/usr/lib/ruby/2.6.0/mkmf.rb:546:inblock in try_link0' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in mktmpdir' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:intry_link0' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in try_link' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:782:intry_func' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1069:in block in have_func' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:inblock in checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:inopen' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:inopen' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:inchecking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1068:in have_func' from extconf.rb:31:in

'

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

/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/bigdecimal-1.4.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/bigdecimal-1.4.4 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/bigdecimal-1.4.4/gem_make.out

brettchalupa commented 3 years ago

@iam-robin thanks for opening this issue with the stack trace! Parsing through those logs, this stands out to me:

You have to install development tools first.

On MacOS, that usually means:

  1. installing XCode from the App Store if you haven't already
  2. then running xcode-select --install from the Terminal.

Would you be able to try those two steps and then gem install dugway again and see if that succeeds?

iam-robin commented 3 years ago

Thanks for the response @brettchalupa! Unfortunately, I've already tried those steps and they lead to the exact same error. I have the xCode version 11.3.1 and reinstalled xcode-select to make sure that I run the newest version.

brettchalupa commented 3 years ago

@iam-robin Hmm, dang! Does sudo gem install dugway make a difference? I'm wondering if it's related to permissions, but I could be wrong.

While doing some other searching online, here are some other options worth trying:

Another option would be to use RVM instead of the MacOS system Ruby, which I don't think will necessarily run into the same exact issues. http://rvm.io

iam-robin commented 3 years ago

@brettchalupa I have found the problem! xCode was indeed the right direction, thanks for that hint :) The problem happened because the xcode-select developer directory was pointing to a wrong directory.

This command fixed the problem: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Thanks for your help!

brettchalupa commented 3 years ago

@iam-robin Glad you got it sorted out, you're welcome!