4

I am trying to install capybara-webkit (0.8.0), but I get the error below, can any body help, I am on ubuntu 11.10.

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

    /home/sam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb  /usr/bin/qmake /usr/bin/make cd src/ && /usr/bin/qmake

/home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/src/webkit_server.pro -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile.webkit_server /usr/bin/make cd src/ && make -f Makefile.webkit_server make[1]: Entering directory /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/src' g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I. -o RequestedUrl.o RequestedUrl.cpp make[1]: g++: Command not found make[1]: *** [RequestedUrl.o] Error 127 make[1]: Leaving directory /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/src' make: * [sub-src-webkit_server-pro-make_default-ordered] Error 2

make cd src/ && make -f Makefile.webkit_server make[1]: Entering directory /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/src' g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtWebKit -I/usr/include/qt4 -I. -o RequestedUrl.o RequestedUrl.cpp make[1]: g++: Command not found make[1]: *** [RequestedUrl.o] Error 127 make[1]: Leaving directory /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/src' make: * [sub-src-webkit_server-pro-make_default-ordered] Error 2

Gem files will remain installed in /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0 for inspection. Results logged to /home/sam/Documents/RoR/course_builder/CDPATH=/ruby/1.9.1/gems/capybara-webkit-0.8.0/./gem_make.out An error occured while installing capybara-webkit (0.8.0), and Bundler cannot continue. Make sure that gem install capybara-webkit -v '0.8.0' succeeds before bundling.

simo
  • 23,342
  • 38
  • 121
  • 218

1 Answers1

7

According to that log you don't have g++ (the gnu c++ compiler installed) which you'll need to build the gem's native extension. You'll also need the qt development headers

Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174
  • Thanks, can you please point me to where to install the g++ ? I came to unix from .NET world for the sake of RoR, I still need to learn new things, your help is highly appreciated. – simo Jan 22 '12 at 07:25
  • I found t his thread, I think its close to the solution: http://forums.opensuse.org/english/get-technical-help-here/applications/451945-bin-sh-g-command-not-found.html – simo Jan 22 '12 at 08:50
  • 4
    on ubuntu it would seem that the package is just called g++. Install it with something like `apt-get install g++` – Frederick Cheung Jan 22 '12 at 13:03
  • how can I know which version of g++ is required for capybara-webkit (0.8.0) native extensions ? apt-get install g++ will install g++ 4.6 – simo Jan 22 '12 at 13:32
  • it worked! I've installed g++ and, yes, native extension is installed now :-) – simo Jan 22 '12 at 18:49
  • Yay! Glad you found the answer! – RyanWilcox Jan 23 '12 at 14:59