mina-deploy / mina

Blazing fast deployer and server automation tool
https://rubygems.org/gems/mina
Other
4.34k stars 491 forks source link

I got a 'extconf.rb failed' error when mina bundle install #597

Closed xwangzhaox closed 6 years ago

xwangzhaox commented 6 years ago

My environment is: Centos 6.5 mysql 5.6 ruby 2.2.5(rvm) puma and mina ...

When I execute the ‘mina deploy’ command,I got some error msg as follows ` Installing mysql2 0.4.9 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

   current directory:
   /home/xxx/www/xxx/shared/vendor/bundle/ruby/2.2.0/gems/mysql2-0.4.9/ext/mysql2
   /home/xxx/.rvm/rubies/ruby-2.2.5/bin/ruby -r
   ./siteconf20171217-27165-1vu49lh.rb extconf.rb --with-mysql-config=/etc/my.cnf
   checking for rb_absint_size()... yes
   checking for rb_absint_singlebit_p()... yes
   checking for ruby/thread.h... yes
   checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
   checking for rb_thread_blocking_region()... no
   checking for rb_wait_for_single_fd()... yes
   checking for rb_hash_dup()... yes
   checking for rb_intern3()... yes
   checking for rb_big_cmp()... yes
   -----
   Cannot execute mysql_config at /etc/my.cnf
   -----
   *** 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=/home/xxx/.rvm/rubies/ruby-2.2.5/bin/$(RUBY_BASE_NAME)
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysql-config

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

   /home/xxx/www/xxx/tmp/build-151350257610402/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0/mysql2-0.4.9/mkmf.log

   extconf failed, exit code 1

   Gem files will remain installed in
   /home/xxx/www/xxx/tmp/build-151350257610402/vendor/bundle/ruby/2.2.0/gems/mysql2-0.4.9
   for inspection.
   Results logged to
   /home/xxx/www/xxx/tmp/build-151350257610402/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0/mysql2-0.4.9/gem_make.out

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

In that message we can see that my RVM setting is already in force. My ruby version in RVM is 2.2.5. But in the tmp directory the created folder is /home/xxx/www/xxx/tmp/build-151350257610402/vendor/bundle/ruby/2.2.0/. Why is not 2.2.5?

When i execute gem install mysql2 '0.4.9' in ssh command line, it successed. And the mysql config file /etc/my.cnf is does exist.

Why i got this error? Help me! tks!

vemarav commented 6 years ago

I have updated mina gem, then it throws some weird errors. But, bundle exec mina deploy solved my problem. I hope it helps.

d4be4st commented 6 years ago

This looks like your system mysql and mysql gem are not compatible.

usually an update of myslq gem helps.

But not mina issue