cloudfoundry / ruby-buildpack

Cloud Foundry buildpack for Ruby, Sinatra and Rails
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
65 stars 160 forks source link

mysql2 0.5.2 gem will not install #110

Closed crstamps2 closed 5 years ago

crstamps2 commented 5 years ago

What version of Cloud Foundry and CF CLI are you using?

➜ cf curl /v2/info && cf version
{
   "name": "Pivotal Application Service",
   "build": "2.2.12-build.64",
   "support": "https://support.pivotal.io",
   "version": 0,
   "description": "https://docs.pivotal.io/pivotalcf/2-2/pcf-release-notes/runtime-rn.html",
   "authorization_endpoint": [redacted],
   "token_endpoint": [redacted],
   "min_cli_version": "6.23.0",
   "min_recommended_cli_version": "6.23.0",
   "api_version": "2.112.0",
   "app_ssh_endpoint": [redacted],
   "app_ssh_host_key_fingerprint": "35:6e:67:51:ec:53:9d:d9:e4:91:82:c5:0b:bb:bc:f4",
   "app_ssh_oauth_client": "ssh-proxy",
   "doppler_logging_endpoint": [redacted],
   "routing_endpoint": [redacted],
   "user": "26c97ef5-da62-4255-9046-9c98e5dd22ce"
}
cf version 6.43.0+815ea2f3d.2019-02-20

What version of the buildpack you are using? ruby_buildpack-cached-cflinuxfs2-v1.7.33+1550682985.zip

If you were attempting to accomplish a task, what was it you were attempting to do? Trying to push an app that has version 0.5.2 of the mysql2 gem as the DB adapter.

You get the following error:

          Installing mysql2 0.5.2 with native extensions
          Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

          current directory:
          /tmp/contents253677609/deps/0/vendor_bundle/ruby/2.5.0/gems/mysql2-0.5.2/ext/mysql2
          /tmp/contents253677609/deps/0/ruby/bin/ruby -I
          /tmp/contents253677609/deps/0/ruby/lib/ruby/site_ruby/2.5.0 -r
          ./siteconf20190320-62-ylmksk.rb extconf.rb
          --with-ldflags\=-L/usr/local/opt/openssl/lib\
          --with-cppflags\=-I/usr/local/opt/openssl/include
          checking for rb_absint_size()... *** 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=/tmp/contents253677609/deps/0/ruby/bin/$(RUBY_BASE_NAME)
          /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:456:in `try_do': The
          compiler failed to generate an executable file. (RuntimeError)
          You have to install development tools first.
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:541:in
          `try_link0'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:559:in
          `try_link'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:771:in
          `try_func'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:1058:in `block
          in have_func'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:948:in `block in
          checking_for'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:350:in `block (2
          levels) in postpone'
                from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:320:in `open'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:350:in `block in
          postpone'
                from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:320:in `open'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:346:in
          `postpone'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:947:in
          `checking_for'
          from /tmp/contents253677609/deps/0/ruby/lib/ruby/2.5.0/mkmf.rb:1057:in
          `have_func'
                from extconf.rb:25:in `<main>'

          To see why this extension failed to compile, please check the mkmf.log which can
          be found here:

          /tmp/contents253677609/deps/0/vendor_bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/mysql2-0.5.2/mkmf.log

          extconf failed, exit code 1

          Gem files will remain installed in
          /tmp/contents253677609/deps/0/vendor_bundle/ruby/2.5.0/gems/mysql2-0.5.2 for
          inspection.
          Results logged to
          /tmp/contents253677609/deps/0/vendor_bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0-static/mysql2-0.5.2/gem_make.out

          An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
          Make sure that `gem install mysql2 -v '0.5.2' --source
          '[redacted]'`
          succeeds before bundling.

          In Gemfile:
            mysql2
          **ERROR** Unable to install gems: exit status 5
   Failed to compile droplet: Failed to run all supply scripts: exit status 15
   Exit status 223

What did you expect to happen? The gem to install properly.

What was the actual behavior? The app push was not successful.

Please confirm where necessary:

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/164767987

The labels on this github issue will be updated when the story is started.

dfreilich commented 5 years ago

Hi @crstamps2 - Can we get a sample app to reproduce the issue? I tried reproducing the issue (our ruby_2.2_bundler_2 fixture uses mysql2 0.5.2), and successfully built the app with no issues.

tylerphelan commented 5 years ago

@crstamps2 closing this one out since we can't reproduce and we have a passing test that is using this gem. If you're seeing issues with PAS, opening a Pivotal support ticket is a way to get quicker responses.