Heroku / Ruby с пакетом GSL - PullRequest
       8

Heroku / Ruby с пакетом GSL

0 голосов
/ 28 августа 2018

Как привязки GSL, необходимые для гема rb-gsl, могут быть установлены в Heroku для приложения Rails 5?

Полагаю, нужно несколько сборок, один раз для gsl, один раз для Ruby. Поэтому я попытался использовать самый последний (3 года назад) обновленный сборочный пакет https://github.com/gregory/heroku-gsl-buildpack, который также упоминался здесь некоторое время назад: Heroku / Rails: Как установить научную библиотеку GNU (GSL) на Heroku? - в комментарии упоминается, что нужно установить LD_LIBRARY_PATH. Но что-то должно было измениться с тех пор, как на этот вопрос был дан ответ, и, к сожалению, я не могу найти информацию, которая более актуальна:

$ heroku buildpacks:clear
$ heroku buildpacks:add git://github.com/gregory/heroku-gsl-buildpack.git#gsl-1.16
$ heroku buildpacks:add heroku/ruby
$ heroku config:set LD_LIBRARY_PATH=/app/vendor/gsl/lib

Оба пакета сборки отображаются правильно:

$ heroku buildpacks
=== appname Buildpack URLs
1. git://github.com/gregory/heroku-gsl-buildpack.git#gsl-1.16
2. heroku/ruby

К сожалению git push heroku master терпит неудачу - и хотя я не знаю, как должна выглядеть установка, такое ощущение, что привязки gsl просто загружаются и распаковываются, но не собираются? Смотрите здесь:

$ git push heroku master
…
remote: Building source:
remote:
remote: -----> GSL 1.15 app detected
remote: -----> Installing GSL 1.16
remote: --2018-08-28 11:31:25--  https://github.com/gregory/heroku-gsl-buildpack/raw/gsl-1.16/gsl-1.16.tar.gz
…
remote: HTTP request sent, awaiting response... 200 OK
…
remote: 2018-08-28 11:31:26 (74.5 MB/s) - ‘gsl-1.16.tar.gz’ saved [8214058/8214058]
remote:
remote: ./
remote: ./include/
remote: ./include/gsl/
…
remote: ./lib/
…
remote: ./bin/
remote: ./bin/gsl-histogram
remote: ./bin/gsl-config
remote: ./bin/gsl-randist
remote: ./share/
…
remote: ./share/man/man1/gsl-histogram.1
remote: ./share/man/man1/gsl-randist.1
remote: ./share/man/man1/gsl-config.1
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.0
remote: -----> Installing dependencies using bundler 1.15.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem     install bundler`.
remote:        Fetching gem metadata from https://rubygems.org/.........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
…
remote:        Fetching gsl 2.1.0.3
remote:        Installing gsl 2.1.0.3 with native extensions
…
remote:        Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:
remote:        current directory:
remote:        /tmp/build_a16a258cc52f9887719444fc25fc24ba/vendor/bundle/ruby/2.5.0/gems/gsl-2.1.0.3/ext/gsl_native
remote:        /tmp/build_a16a258cc52f9887719444fc25fc24ba/vendor/ruby-2.5.0/bin/ruby -r
remote:        ./siteconf20180828-229-x5tnap.rb extconf.rb
remote:        *** ERROR: missing required library to compile this module: No such file or
remote:        directory - gsl-config
remote:        *** extconf.rb failed ***
remote:        Could not create Makefile due to some reason, probably lack of necessary
remote:        libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote:        need configuration options.
remote:
remote:        Provided configuration options:
remote:            --with-opt-dir
remote:            --without-opt-dir
remote:            --with-opt-include
remote:            --without-opt-include=${opt-dir}/include
remote:            --with-opt-lib
remote:            --without-opt-lib=${opt-dir}/lib
remote:            --with-make-prog
remote:            --without-make-prog
remote:            --srcdir=.
remote:            --curdir
remote:        --ruby=/tmp/build_a16a258cc52f9887719444fc25fc24ba/vendor/ruby-2.5.0/bin/$(RUBY_BASE_NAME)
remote:            --with-gsl-version
remote:
remote:        extconf failed, exit code 1
remote:
remote:        Gem files will remain installed in
remote:        /tmp/build_a16a258cc52f9887719444fc25fc24ba/vendor/bundle/ruby/2.5.0/gems/gsl-2.1.0.3
remote:        for inspection.
remote:        Results logged to
remote:        /tmp/build_a16a258cc52f9887719444fc25fc24ba/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/gsl-2.1.0.3/gem_make.out
remote:
remote:        An error occurred while installing gsl (2.1.0.3), and Bundler cannot continue.
remote:        Make sure that `gem install gsl -v '2.1.0.3'` succeeds before bundling.
…
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed    

Любая помощь высоко ценится.

...