2017-08-01 152 views
0

我在安裝cups 0.1.10 gem時遇到問題。 當我的項目文件夾中運行bundle install的過程,因爲下面的錯誤而中斷:在Linux上安裝杯子Gem時出錯Mint

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

current directory: /tmp/bundler20170801-5492-c0toxgcups-0.1.10/gems/cups-0.1.10/ext 
/usr/bin/ruby2.3 -r ./siteconf20170801-5492-1frgnir.rb extconf.rb 
checking for main() in -lcups... no 
*** 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=/usr/bin/$(RUBY_BASE_NAME)2.3 
    --with-cupslib 
    --without-cupslib 
Couldn't find CUPS libraries on your system. Check they're installed and in your path. 

To see why this extension failed to compile, please check the mkmf.log which can be found here: 

    /tmp/bundler20170801-5492-c0toxgcups-0.1.10/extensions/x86_64-linux/2.3.0/cups-0.1.10/mkmf.log 

extconf failed, exit code 1 

Gem files will remain installed in /tmp/bundler20170801-5492-c0toxgcups-0.1.10/gems/cups-0.1.10 for inspection. 
Results logged to /tmp/bundler20170801-5492-c0toxgcups-0.1.10/extensions/x86_64-linux/2.3.0/cups-0.1.10/gem_make.out 

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

我已經克隆在OS X塞拉利昂10.12.6倉庫,和我一點問題都沒有。我試過使用rvm來安裝和使用OS X上安裝的相同版本的ruby,但仍然沒有運氣。

紅寶石的系統版本的Linux Mint的是ruby2.3.1pp112,我已經使用sudo apt-get install ruby2.3-dev還安裝ruby-dev,因爲我在很多地方,這是一個合適的解決問題的辦法讀過,但它presists。

回答

1

的錯誤信息是:

Couldn't find CUPS libraries on your system. Check they're installed and in your path. 

安裝CUPS庫和重試bundle install

sudo apt-get install libcups2-dev 
sudo apt-get install libcupsimage2-dev 

這是紅寶石安裝寶石當公共圖案;如果必須編譯依賴於第三方庫的本機擴展,則需要先安裝第三方庫。像mysql2pgnokogiri等其他寶石都將具有相同的行爲,並要求安裝相應的庫。