2016-08-14 79 views
0

我想安裝gem capybara-webkit但是當我運行bundle install,我收到以下錯誤水豚,WebKit的:無法安裝,即使QT安裝

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

/home/dineshp/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160814-4696-3d7ixk.rb extconf.rb 
*** 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=/home/dineshp/.rvm/rubies/ruby-2.2.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 ' not available 

extconf failed, exit code 1 

Gem files will remain installed in /home/dineshp/.rvm/gems/[email protected]/gems/capybara-webkit-1.11.1 for inspection. 
Results logged to /home/dineshp/.rvm/gems/[email protected]/extensions/x86_64-linux/2.2.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. 

由於上述錯誤顯示:命令「QMAKE」不可用,我嘗試使用以下命令指this後安裝qt

sudo apt-get install libqt4-dev libqtwebkit-dev 

當我鍵入qmake --version,我得到的followi NG消息:

The program 'qmake' is currently not installed. You can install it by typing: 
sudo apt-get install qtchooser 

正如我知道我已經安裝了QT,我試圖運行qtchooser -list-versions,我得到QT版本的下面的列表在我的系統:

4 
5 
default 
qt4-i386-linux-gnu 
qt4-x86_64-linux-gnu 
qt4 
qt5-x86_64-linux-gnu 
qt5 

爲什麼我不能夠訪問qmake來自Ubuntu 14.04終端的命令?

回答

0

qtchooser允許您選擇默認版本的Qt在您的路徑中可訪問。你還沒有做出這個選擇。您不僅需要安裝qtchooser,還必須使用它來進行選擇。

+0

感謝您的迴應:)...我做了'export QT_SELECT = qt5',然後檢查了'qtchooser -print-env',得到的結果如下:'QT_SELECT =「qt5」 QTTOOLDIR =「/ usr/lib/x86_64-linux-gnu/qt5/bin「 QTLIBDIR =」/ usr/lib/x86_64-linux-gnu「 - 然後我再次嘗試了'qmake -v',但是我得到了''程序'qmake'目前沒有安裝。您可以通過鍵入以下內容來安裝它: sudo apt-get install qtchooser' – dp7

+0

@dkp我不認爲這是如何工作的。如果'qt_chooser'與BSD上的'port --select'類似,那麼你必須做'qt_chooser qt5'來產生符號鏈接。如果失敗了,那麼你需要手動調用正確的qmake,或者將它添加到'.bash_profile'中的路徑中。 –