我正在尝试使用GMP库为加密部署Ruby on Rails应用程序。一切都在发展中很好。
当我git推送到Heroku或者Openshift时,我得到的错误信息是:
remote: Installing gmp (0.5.47) with native extensions .........
remote:
remote: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote:
remote: /opt/rh/ruby193/root/usr/bin/ruby extconf.rb
remote: checking for gmp.h... no
remote: can't find gmp.h, try --with-gmp-include=<path>
remote: checking for __gmpz_init() in -lgmp... no
remote: can't find -lgmp, try --with-gmp-lib=<path>
remote: checking for mpfr.h... no
remote: checking for SIZEOF_INTPTR_T... yes
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of
remote: necessary libraries and/or headers. Check the mkmf.log file for more
remote: details. You may need configuration options.
事实证明,Heroku支持承认他们的堆栈图像尚未包含GMP。 他们建议我编写自己的buildpack以在生产服务器上包含GMP库。 看完custom buildpack for OpennSSL here之后我也不知道了。 欢迎任何建议。