Problem
I am trying to install ruby gem proj4rb on heroku, which requires C header files proj_api PROJ.4.
By clicking on the hero, I get the following error (only the corresponding lines are shown):
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/ruby-2.1.5/bin/ruby extconf.rb
checking for proj_api.h... no
extconf.rb:6:in `<main>': Cannot find proj_api.h header (RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in /tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/bundle/ruby/2.1.0/gems/proj4rb-1.0.0 for inspection.
Results logged to /tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/proj4rb-1.0.0/gem_make.out
An error occurred while installing proj4rb (1.0.0), and Bundler cannot continue.
Make sure that `gem install proj4rb -v '1.0.0'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/...........
...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/ruby-2.1.5/bin/ruby extconf.rb
checking for proj_api.h... no
extconf.rb:6:in `<main>': Cannot find proj_api.h header (RuntimeError)
extconf failed, exit code 1
Gem files will remain installed in /tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/bundle/ruby/2.1.0/gems/proj4rb-1.0.0 for inspection.
Results logged to /tmp/build_2701eb422e13f4f8f7a20fe030059498/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/proj4rb-1.0.0/gem_make.out
An error occurred while installing proj4rb (1.0.0), and Bundler cannot continue.
Make sure that `gem install proj4rb -v '1.0.0'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
I know that construction takes place on a special container, and then is deployed in the hero. This is why I use buildpacks with the two lines shown below, which include. Although Heroku compiles ruby, I get the indicated error.
I'm a little confused what works
heroku run bash
and then
gem install proj4rb
works without errors. Therefore, I assume that the buildpack installation really works, and the headers are found this way.
Question
, ? : , geo-buildpack? buildpack ruby? ruby-buildpack/geo-buildpack?
. , , .
heroku get-startet rails-project "" buildpacks.
Gemfile:
source 'https://rubygems.org'
ruby '2.1.5'
gem 'rails', '4.1.8'
gem 'pg'
gem 'rails_12factor', group: :production
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'unicorn'
gem 'proj4rb', '~> 1.0.0'
.buildpacks:
https://github.com/cyberdelia/heroku-geo-buildpack.git
https://github.com/heroku/heroku-buildpack-ruby