error installing capybara-webkit. Can not compile

292 views Asked by At

I can not handle the situation to install capybara-webkit on yosemity Any idea is welcome.

Installing capybara-webkit (1.3.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/boti/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb 
cd src/ && /usr/local/bin/qmake /Users/boti/.rvm/gems/ruby-2.0.0-p353@myaidin/gems/capybara-webkit-1.3.1/src/webkit_server.pro -spec /usr/local/Cellar/qt/4.8.7/mkspecs/macx-g++ -o Makefile.webkit_server
cd src/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webkit_server 
g++ -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.7/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/include -Ibuild -F/usr/local/Cellar/qt/4.8.7/lib -x c++-header -c stable.h -o build/webkit_server.gch/c++
gcc -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.7/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/include -Ibuild -F/usr/local/Cellar/qt/4.8.7/lib -x objective-c++-header -c stable.h -o build/webkit_server.gch/objective-c++
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55,
                 from /System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:12,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:80,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /usr/local/Cellar/qt/4.8.7/include/QtGui/qmacdefines_mac.h:113,
                 from /usr/local/Cellar/qt/4.8.7/include/QtGui/qwindowdefs.h:99,
                 from /usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers/qapplication.h:46,
                 from /usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers/QApplication:1,
                 from stable.h:1:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262: error: expected `}' before ‘__attribute__’
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262: error: expected unqualified-id before ‘=’ token
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414: error: expected `}' before ‘__attribute__’
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414: error: expected unqualified-id before ‘=’ token
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:493: error: expected declaration before ‘}’ token
make[1]: *** [build/webkit_server.gch/objective-c++] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2
Command 'make' failed

make "DESTDIR="
cd src/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webkit_server 
gcc -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.7/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtWebKit.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/include -Ibuild -F/usr/local/Cellar/qt/4.8.7/lib -x objective-c++-header -c stable.h -o build/webkit_server.gch/objective-c++
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55,
                 from /System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:12,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:80,
                 from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
                 from /usr/local/Cellar/qt/4.8.7/include/QtGui/qmacdefines_mac.h:113,
                 from /usr/local/Cellar/qt/4.8.7/include/QtGui/qwindowdefs.h:99,
                 from /usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers/qapplication.h:46,
                 from /usr/local/Cellar/qt/4.8.7/lib/QtGui.framework/Versions/4/Headers/QApplication:1,
                 from stable.h:1:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262: error: expected `}' before ‘__attribute__’
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262: error: expected unqualified-id before ‘=’ token
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414: error: expected `}' before ‘__attribute__’
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414: error: expected unqualified-id before ‘=’ token
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:493: error: expected declaration before ‘}’ token
make[1]: *** [build/webkit_server.gch/objective-c++] Error 1
make: *** [sub-src-webkit_server-pro-make_default-ordered] Error 2


Gem files will remain installed in /Users/boti/.rvm/gems/ruby-2.0.0-p353@myaidin/gems/capybara-webkit-1.3.1 for inspection.
Results logged to /Users/boti/.rvm/gems/ruby-2.0.0-p353@myaidin/gems/capybara-webkit-1.3.1/./gem_make.out

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

There are 1 answers

0
Joe Ferris On BEST ANSWER

It looks like you're using gcc, which has trouble compiling some of Apple's newer frameworks.

If your CC or CXX environment variables are set, make sure they're set to cc and c++ and not something like gcc and g++.