2012-05-07 12 views
2

私はRailsアプリケーションでlibarchiveを動作させようとしています。具体的には、ファイルを解凍し、その内容を.CPGZファイルとして再圧縮する必要があります。私はLibarchiveがこれに最善の策だと信じています。Libarchive Gem Not Working(RoR)

ただし、バンドルインストールを実行すると、次のエラーが表示されます。(archive.hが不足していると文句を言う)

Using heroku (2.24.1) 
Using multi_xml (0.4.4) 
Using httparty (0.8.3) 
Using itunes-search-api (0.1.0) 
Using kgio (2.7.4) 
Using less (2.2.1) 
Using less-rails (2.2.2) 
Installing libarchive (0.1.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

     /Users/Chris/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for gcc... gcc 
checking for C compiler default output file name... a.out 
checking whether the C compiler works... yes 
checking whether we are cross compiling... no 
checking for suffix of executables... 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking for special C compiler options needed for large files... no 
checking for _FILE_OFFSET_BITS value needed for large files... no 
checking for a BSD-compatible install... /usr/bin/install -c 
configure: creating ./config.status 
config.status: creating config.h 
checking for config.h... yes 
checking for archive.h... 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=/Users/Chris/.rvm/rubies/ruby-1.9.2-p290/bin/ruby 


Gem files will remain installed in /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/libarchive-0.1.2 for inspection. 
Results logged to /Users/Chris/.rvm/gems/ruby-1.9.2-p290/gems/libarchive-0.1.2/ext/gem_make.out 
An error occured while installing libarchive (0.1.2), and Bundler cannot continue. 
Make sure that `gem install libarchive -v '0.1.2'` succeeds before bundling. 

私のGemfileはかなり標準的であると私はHerokuの上でこれを実行していることになるラインgem 'libarchive'

が含まれています。

アイデア?

+0

get install libarchive -v '0.1.2'を呼び出した結果を貼り付けることができますか?また、mkmf.logの内容は何ですか? –

+0

@izomorphius:それは 'ネイティブ拡張の構築。これはしばらく時間がかかることがあります。そして最後の2行を除いて、上記とまったく同じ出力を吐き出します。私のコンピュータ上でファイルmkmf.logを見つけることができません(Spotlightでは出現しませんでした...) –

答えて

1

これは、Herokuがスタックにlibarchiveライブラリを持っていないということです。どちらもシーダーで動作しません、私は知っている。悲しいことに、libarchive gemを使うことはできません。なぜなら、それがCライブラリを包み込むまでは、単にCライブラリの周りのラッパーに過ぎないからです。

+2

これまでのところ、「libarchive-static」という静的にリンクされたlibarchive宝石があります。それはHerokuで動作します。 –