thoughtbot / capybara-webkit

A Capybara driver for headless WebKit to test JavaScript web apps
https://thoughtbot.com/open-source
MIT License
1.97k stars 428 forks source link

OSX 10.11 qt55 qmake error #948

Closed Judahmeek closed 8 years ago

Judahmeek commented 8 years ago

Having successfully installed qt55,...

brew tap homebrew/versions
brew install qt55
brew link --force qt55
which qmake # returns correct directory

...I get the following error when attempting to bundle capybara-webkit: 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/lib' failed

I've checked /usr/local/opt/ and libyaml, readline, libska, and openssl are all there. Running 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/lib directly from the terminal opens help like there's some sort of syntax error.

Anyone run into a similar issue?

jferris commented 8 years ago

Is there any other output when you try gem install capybara-webkit? Do you know which version you're trying to install?

Judahmeek commented 8 years ago

Here is all the error output:

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

current directory:
/Users/judahmeek/.rvm/gems/ruby-2.3.1/gems/capybara-webkit-1.11.1
/Users/judahmeek/.rvm/rubies/ruby-2.3.1/bin/ruby -r
./siteconf20160914-484-138wg7q.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/judahmeek/.rvm/rubies/ruby-2.3.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/lib' failed

extconf failed, exit code 1

Gem files will remain installed in
/Users/judahmeek/.rvm/gems/ruby-2.3.1/gems/capybara-webkit-1.11.1 for
inspection.
Results logged to
/Users/judahmeek/.rvm/gems/ruby-2.3.1/extensions/x86_64-darwin-15/2.3.0/capybara-webkit-1.11.1/gem_make.out

An error occurred while installing capybara-webkit (1.11.1), and
Bundler cannot continue.
Make sure that \'gem install capybara-webkit -v '1.11.1'\' succeeds before
bundling.

Backticks inside quote changed to \'. Also, I have already accepted the Xcode license agreement.

Judahmeek commented 8 years ago

@jferris This proved to be a duplication of https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#xcode-80 (except that I've got XCode 8.0 on OS X El Capitan now and the path was slightly different: [Qt_install_folder]/[Qt_version]/mkspecs/features/default_pre.prf)

If I hadn't screwed up my grep the first time I looked for that line, I could have saved us both some trouble.

Edit: thanks for reminding me to update my link, @seanlinsley

jferris commented 8 years ago

Glad to hear you've solved it. Installing Qt can be rough.

seanlinsley commented 8 years ago

I also ran into this problem.

The wiki link above is no longer valid. Here's what it is now: https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#xcode-80

RemyMaucourt commented 6 years ago

@Judahmeek I have the exact same problem, and I can't find the solution you mention in the link. Can you elaborate a little?

Judahmeek commented 6 years ago

Yeah, link rot is an issue with wiki pages. Fortunately, we have the revision history. Here is a link to the missing section.

@aripollak is there any particular reason you removed that section when you updated the wiki?

aripollak commented 6 years ago

Yeah, I thought that issue was fixed with newer versions of the Homebrew package. Is that not the case?

vassilevsky commented 6 years ago

I have just upgraded to macOS High Sierra 10.13.1 and Command Line Tools 9.1 and I have the same problem 💖

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

    current directory: /Users/vassilevsky/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.14.0
/Users/vassilevsky/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20171114-22943-zeyu64.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 ***
seanlinsley commented 6 years ago

@vassilevsky it looks like you just need to accept the Xcode license. You can do that with:

sudo xcode-select -r
vassilevsky commented 6 years ago

I have installed and launched Xcode and then it worked.

yunixon commented 6 years ago
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun
elgreco commented 6 years ago

If you're on MacOS and have installed QT 5.5+ with Brew, make sure that the binary is linked correctly. You can tell it is pointing to the qmake binary correctly by running:

$ which qmake

and seeing that it returns something like /usr/local/opt/qt@5.5/bin/qmake. If it doesn't return anything, it needs to be linked. To link it run this:

$ echo 'export PATH="$(brew --prefix qt@5.5)/bin:$PATH"' >> ~/.bashrc