0

After much looking, even here on StackOverflow, I still can't seem to get the Capybara gem installed to finish my Ruby on Rails project, here's the error message I get when running

gem install capybara-webkit 

The error I get is

current directory: /Users/montana/.rvm/gems/ruby-2.4.1/gems/capybara-webkit-1.14.0
/Users/montana/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20171019-31585-1203ped.rb extconf.rb
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
*** 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
    --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=/Users/montana/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
    --with-gl-dir
    --without-gl-dir
    --with-gl-include
    --without-gl-include=${gl-dir}/include
    --with-gl-lib
    --without-gl-lib=${gl-dir}/lib
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
Command 'qmake LIBS\ \+\=\ -L/usr/local/opt/libyaml/lib\ -L/usr/local/opt/readline/lib\ -L/usr/local/opt/libksba/lib\ -L/usr/local/opt/openssl@1.1/lib' failed

extconf failed, exit code 1

Gem files will remain installed in /Users/montana/.rvm/gems/ruby-2.4.1/gems/capybara-webkit-1.14.0 for inspection.
Results logged to /Users/montana/.rvm/gems/ruby-2.4.1/extensions/x86_64-darwin-17/2.4.0/capybara-webkit-1.14.0/gem_make.out

Any help is greatly appreciated, as always, cheers, and happy coding!

Montana
  • 53
  • 1
  • 10
  • capybara-webkit depends on a WebKit implementation from Qt. Have you read https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#xcode-80? – Kevin Etore Oct 19 '17 at 08:17
  • Hey Kevin, yes I have installed qt, and symlinked it. Which is why it's got me stumped. I guess I could try using brew (my package manager of OS X) and reinstalling, then try symlinking again? – Montana Oct 19 '17 at 08:20

1 Answers1

0

Capybara-webkit require some native extensions and does use a compiler to build them.

You're using OS X, so you have to accept the Xcode license agreement before use the compiler with:

sudo xcodebuild -license accept
spuyet
  • 81
  • 7
  • Thanks for the advice spuyet, yeah I've ran that, and got "xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance" – Montana Oct 19 '17 at 08:21
  • Do you have Xcode installed ? if not, go to the app store and download it :) – spuyet Oct 19 '17 at 08:24
  • Do I really need Xcode? I installed the CLI tools, I thought that would be enough, and when you install the CLI tools, you accept the agreement. Again, I really appreciate the help spuyet. – Montana Oct 19 '17 at 08:26
  • I just don't develop in Xcode, I'm using JetBrains software (e.g.) RubyMine, PyCharm and not developing in Swift. So i feel like there's no need to waste HD space, unless I can install Xcode, accept the agreement and remove it. Which still doesn't explain why I can't sudo xcodebuild -license accept. – Montana Oct 19 '17 at 08:30
  • Yes, you have a more detailed answer here : https://stackoverflow.com/a/17980786/7175012 – spuyet Oct 19 '17 at 08:30
  • I understand but the error is clear :) : tool `'xcodebuild' requires Xcode` – spuyet Oct 19 '17 at 08:33