Mac OS 10.14 Mojave + qt5.5 + gem capybara-webkit
Asked Answered
S

5

7

My config is MAC Mojave v10.14.

I try to install gem Capybara-webkit -v '1.15.0' which need qt5.5, but qt5.5 has been dropped of the homebrew and it is not compatible with Xcode v10.

I try this :

  • Uninstall Xcode v10
  • Install Xcode 9.4.1, found in developer.apple.com/
  • Install qt5.5, I have found it in the archives on qt.io/
  • Run bundle

But it fail, my error is with the gem capybara-webkit -v '1.15.0':

Fetching capybara-webkit 1.15.0
Installing capybara-webkit 1.15.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: 
/Users/thomas/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara- 
webkit-1.15.0
/Users/thomas/.rbenv/versions/2.4.4/bin/ruby -r ./siteconf20181005-763-1bppnfh.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
--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=/Users/thomas/.rbenv/versions/2.4.4/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 ' failed

extconf failed, exit code 1

 Gem files will remain installed in 
/Users/thomas/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/capybara-webkit-1.15.0 for inspection.
Results logged to /Users/thomas/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/extensions/x86_64- darwin-18/2.4.0-static/capybara-webkit-1.15.0/gem_make.out

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

In Gemfile:
capybara-webkit

Next, I did:

sudo xcodebuild -license agree

But the error persists...

Thank you for your help !

Salomie answered 5/10, 2018 at 8:9 Comment(1)
Please post your solution as an answer to your question. You can then accept your own answer. That way it is easier for people to search if they have similar issues.Europeanize
N
5

Here's what worked for me, found here:

  • Keep your xcode v10 installed
  • Manually download and install Qt 5.5 from their website
  • Add Qt's bin path to your PATH environment variable by adding this to your .bashrc, .zshrc or any other shell configuration that you have: (make sure to replace /Applications/Qt/5.5/clang_64/bin with your Qt bin path)
export PATH="/Applications/Qt/5.5/clang_64/bin:$PATH" # Add Qt bin to path for capybara webkit to work
  • Run gem install capybara-webkit
Newby answered 11/3, 2019 at 15:32 Comment(2)
What's annoying now is they removed Qt 5.5 from their website. Link is brokenEgyptian
@BasharAbdullah they moved it to download.qt.io/new_archive/qt/5.5/5.5.0Essential
W
8

As described on the capybara-webkit wiki, capybara-webkit depends on Qt 5.5. "Qt 5.5 is the last version of Qt that capybara-webkit will support. The Qt project has dropped the WebKit bindings from binary releases in 5.6."

To install Qt 5.5 follow the instructions from the wiki. For Mojave, the instructions are the following.

brew update
cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/[email protected]
brew install [email protected]
echo 'export PATH="$(brew --prefix [email protected])/bin:$PATH"' >> ~/.bashrc

You can confirm this step worked by running:

$ which qmake
/usr/local/opt/[email protected]/bin/qmake

Next, you need to install Xcode 9.4. Xcode 10 is not compatible with Qt 5.5. Xcode 9.4 can be downloaded from the Apple developer portal. This is a 4GB download and takes about 30 minutes to download and install. You can verify it's correctly installed by running the following:

$ /usr/bin/xcodebuild -version
Xcode 9.4.1
Build version 9F2000

If this doesn't work, it may be because you have only the Command Line Tools installed instead of Xcode, in which case you should make sure you downloaded the right version of Xcode. Or the Xcode folder may set incorrectly. If so, you can fix this using xcode-select, which will specifiy the folder in which xcodebuild runs:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

When Xcode is finally installed, locate it in your Applications folder, open it, and agree to the license. Then try reinstalling capybara-webkit.


Disclaimer: I came up with the above answer from compiling multiple questions and answers and trying to remember the order in which I ran commands on my local machine. I may have accidentally omitted some steps.

Woodshed answered 6/12, 2018 at 0:40 Comment(2)
The full manual here github.com/thoughtbot/capybara-webkit/wiki/… It has useful notes. Helped me to install capybara-webkit on MojavePleinair
I get an error running brew install [email protected] on OS X Mojave: Error: [email protected]: unknown version :mountain_lion - following the update here: #54500393 seems to have resolved the problemMcfall
N
5

Here's what worked for me, found here:

  • Keep your xcode v10 installed
  • Manually download and install Qt 5.5 from their website
  • Add Qt's bin path to your PATH environment variable by adding this to your .bashrc, .zshrc or any other shell configuration that you have: (make sure to replace /Applications/Qt/5.5/clang_64/bin with your Qt bin path)
export PATH="/Applications/Qt/5.5/clang_64/bin:$PATH" # Add Qt bin to path for capybara webkit to work
  • Run gem install capybara-webkit
Newby answered 11/3, 2019 at 15:32 Comment(2)
What's annoying now is they removed Qt 5.5 from their website. Link is brokenEgyptian
@BasharAbdullah they moved it to download.qt.io/new_archive/qt/5.5/5.5.0Essential
S
2

I think my problem was with xcrun. For fix I did :

  • sudo chown root:wheel /Applications/Xcode.app
  • sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
  • cd /Applications/Xcode.app/Contents/Developer/usr/bin/
  • sudo ln -s xcodebuild xcrun

And it work (y) !

Salomie answered 5/10, 2018 at 12:14 Comment(0)
U
0

You need Xcode 9.4.1 to install [email protected] as it's not compatible with Xcode 10. Homebrew has deleted the [email protected] from their core tap so to install it you need to run the following before:

brew update
cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/[email protected]
brew install [email protected]

9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 is the parent commit of 360923286c0f1a6a1325ada578df030bf579009f where they removed [email protected] so this command rollbacks to the parent commit and checkout the needed formula file.

Unbounded answered 7/10, 2018 at 21:52 Comment(5)
I still have problems to install Qt5.5. ../src/corelib/global/qglobal.h:39:12: fatal error: 'cstddef' file not found # include <cstddef>Guv
Are you using home brew?Unbounded
Yes, I have reinstall Mojave from scratch and install Xcode 9.4.1 and follow this steps but I still unlucky. I got the message that Xcode and CommandLineTools are outdated so I can install [email protected].Guv
NOTE: If you got error fatal: reference is not a tree: 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97, use git fetch --unshallow to complete git history. NOTE: If you get Error: [email protected]: unknown version :mountain_lion, comment line #25 in Formula/[email protected] More details: github.com/thoughtbot/capybara-webkit/wiki/…Pleinair
No Luck with Catalina Error: unknown or unsupported macOS version: :mountain_lionTraitor
D
0

I could install [email protected] on Mojave with this:

brew install [email protected] --force-bottle

With capybara-webkit, I temporarily use this:

gem "capybara-webkit", git: "https://github.com/emilyst/capybara-webkit.git", ref: "9c9af833656f095667e8522004dae017d423d37d"

Dichlamydeous answered 10/10, 2018 at 8:20 Comment(1)
This didn't work for me. ``` Error: No available formula with the name "[email protected]" ==> Searching for a previously deleted formula (in the last month)... [email protected] was deleted from homebrew/core in commit 360923286c: [email protected]: delete ```Junior

© 2022 - 2024 — McMap. All rights reserved.