Ruby on rails Libarchive Gem不工作(RoR)
我正在尝试让libarchive在我的Rails应用程序中工作。具体来说,我需要解压一个文件并将其内容重新压缩为.CPGZ文件。我相信Libarchive是我最好的选择 但是,当我运行bundle安装时,会出现以下错误:(它抱怨archive.h丢失) 我的Gemfile是相当标准的,包括行Ruby on rails Libarchive Gem不工作(RoR),ruby-on-rails,gem,compression,Ruby On Rails,Gem,Compression,我正在尝试让libarchive在我的Rails应用程序中工作。具体来说,我需要解压一个文件并将其内容重新压缩为.CPGZ文件。我相信Libarchive是我最好的选择 但是,当我运行bundle安装时,会出现以下错误:(它抱怨archive.h丢失) 我的Gemfile是相当标准的,包括行gem'libarchive' 我会在Heroku上运行这个 有什么想法吗?我相信这意味着Heroku的堆栈中没有libarchive库。我发现雪松也不管用。唉,因此您不能使用libarchive gem,因
gem'libarchive'
我会在Heroku上运行这个
有什么想法吗?我相信这意味着Heroku的堆栈中没有libarchive库。我发现雪松也不管用。唉,因此您不能使用libarchive gem,因为它只是C库的一个包装,直到它们包含它。您能粘贴调用get install libarchive-v“0.1.2”的结果吗?还有mkmf.log的内容是什么?@izomorphius:它说的是
构建本机扩展。这可能需要一段时间…
,然后输出与上面完全相同的输出,除了最后两行。在我的计算机上找不到文件mkmf.log(没有出现在聚光灯下…)我不久前发现了这一点,有一个静态链接的libarchive gem,称为“libarchive static”。它与Heroku合作。
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.