我有一个使用 的 rails 4 应用程序,ruby-filemagic
因此filemagic
需要在系统上安装。
我已经尝试通过模仿这个问题的解决方案在 Heroku 上安装它,但它就是行不通。我尝试了多种方法,但我认为最有希望的方法是通过apt-get
(修改后的)apt-get、config和ruby buildpacks 的组合进行安装。在配置中,我使用BUNDLE_BUILD__RUBY-FILEMAGIC: --with-magic-dir=/app/.apt/usr/ --with-magic-include=/app/.apt/usr/include --with-magic-lib=/app/.apt/usr/lib
最终,我仍然得到这个:
/tmp/build_29e629f8a00379850ab44096c10f1afc/vendor/ruby-2.0.0/bin/ruby extconf.rb --with-magic-dir=/tmp/build_29e629f8a00379850ab44096c10f1afc/.apt/usr/ --with-magic-include=/tmp/build_29e629f8a00379850ab44096c10f1afc/.apt/usr/include --with-magic-lib=/tmp/build_29e629f8a`00379850ab44096c10f1afc/.apt/usr/lib
checking for main() in -lgnurx... no
checking for magic_open() in -lmagic... no
*** ERROR: missing required library to compile this module
*** 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.
libmagic
确实安装到了这个目录中。它的内容与deb
包裹的内容相当,尽管它看起来确实很轻。