Redmine An error occurred while installing mysql2 (0.5.3)

July 6, 2021 . 5 MIN READ

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gem install mysql2 -v ‘0.4.10’

Fetching: mysql2-0.4.10.gem (100%)

Building native extensions. This could take a while…

ERROR:  Error installing mysql2:

ERROR: Failed to build gem native extension.

 

current directory: /var/lib/gems/2.5.0/gems/mysql2-0.4.10/ext/mysql2

/usr/bin/ruby2.5 -r ./siteconf20191210-9865-1auiv2e.rb extconf.rb

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

checking for mysql_query() in -lmysqlclient… no

—–

mysql client is missing. You may need to ‘apt-get install libmysqlclient-dev’ or ‘yum install mysql-devel’, and try again.

—–

*** 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=/usr/bin/$(RUBY_BASE_NAME)2.5

–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

–without-mysql-config

–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-mysqlclientlib

–without-mysqlclientlib

 

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

 

/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.4.10/mkmf.log

 

extconf failed, exit code 1

 

Gem files will remain installed in /var/lib/gems/2.5.0/gems/mysql2-0.4.10 for inspection.

Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.4.10/gem_make.out

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gem install -g mysql2 -v ‘0.4.10’

ERROR:  While executing gem … (Errno::ENOENT)

No such file or directory @ rb_sysopen – mysql2

root@localhost:/home/runcloud/webapps/app-pmgeekshub#

root@localhost:/home/runcloud/webapps/app-pmgeekshub# build-essential

build-essential: command not found

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gcc –version

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

Copyright (C) 2017 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 

root@localhost:/home/runcloud/webapps/app-pmgeekshub# sudo apt-get update

Hit:1 http://mirrors.linode.com/ubuntu bionic InRelease

Hit:2 http://mirrors.linode.com/ubuntu bionic-updates InRelease

Hit:3 http://mirrors.linode.com/ubuntu bionic-backports InRelease

Hit:4 https://deb.nodesource.com/node_8.x bionic InRelease

Hit:5 http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic InRelease

Hit:6 http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic InRelease

Get:7 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]

Hit:8 https://release.runcloud.io bionic InRelease

Fetched 88.7 kB in 1s (77.6 kB/s)

Reading package lists… Done

root@localhost:/home/runcloud/webapps/app-pmgeekshub# sudo apt-get install build-essential

Reading package lists… Done

Building dependency tree

Reading state information… Done

build-essential is already the newest version (12.4ubuntu1).

0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gem install mysql2 -v ‘0.4.10’

Building native extensions. This could take a while…

ERROR:  Error installing mysql2:

ERROR: Failed to build gem native extension.

 

current directory: /var/lib/gems/2.5.0/gems/mysql2-0.4.10/ext/mysql2

/usr/bin/ruby2.5 -r ./siteconf20191210-10498-mgpuce.rb extconf.rb

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

checking for mysql_query() in -lmysqlclient… no

—–

mysql client is missing. You may need to ‘apt-get install libmysqlclient-dev’ or ‘yum install mysql-devel’, and try again.

—–

*** 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=/usr/bin/$(RUBY_BASE_NAME)2.5

–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

–without-mysql-config

–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-mysqlclientlib

–without-mysqlclientlib

 

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

 

/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.4.10/mkmf.log

 

extconf failed, exit code 1

 

Gem files will remain installed in /var/lib/gems/2.5.0/gems/mysql2-0.4.10 for inspection.

Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/mysql2-0.4.10/gem_make.out

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gem install mysql2 -v ‘0.4.10’^C

root@localhost:/home/runcloud/webapps/app-pmgeekshub# apt-get install libmysqlclient-dev

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following NEW packages will be installed:

libmysqlclient-dev

0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.

Need to get 987 kB of archives.

After this operation, 6,009 kB of additional disk space will be used.

Get:1 http://mirrors.linode.com/ubuntu bionic-updates/main amd64 libmysqlclient-dev amd64 5.7.28-0ubuntu0.18.04.4 [987 kB]

Fetched 987 kB in 0s (47.5 MB/s)

Selecting previously unselected package libmysqlclient-dev.

(Reading database … 148393 files and directories currently installed.)

Preparing to unpack …/libmysqlclient-dev_5.7.28-0ubuntu0.18.04.4_amd64.deb …

Unpacking libmysqlclient-dev (5.7.28-0ubuntu0.18.04.4) …

Setting up libmysqlclient-dev (5.7.28-0ubuntu0.18.04.4) …

Processing triggers for man-db (2.8.3-2ubuntu0.1) …

root@localhost:/home/runcloud/webapps/app-pmgeekshub#  sudo apt-get install build-essential

Reading package lists… Done

Building dependency tree

Reading state information… Done

build-essential is already the newest version (12.4ubuntu1).

0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

root@localhost:/home/runcloud/webapps/app-pmgeekshub# sudo apt-get install build-essential

Reading package lists… Done

Building dependency tree

Reading state information… Done

build-essential is already the newest version (12.4ubuntu1).

0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

root@localhost:/home/runcloud/webapps/app-pmgeekshub# gem install mysql2 -v ‘0.4.10’

Building native extensions. This could take a while…

Successfully installed mysql2-0.4.10

Parsing documentation for mysql2-0.4.10

Installing ri documentation for mysql2-0.4.10

Done installing documentation for mysql2 after 0 seconds

1 gem installed

root@localhost:/home/runcloud/webapps/app-pmgeekshub#

Leave a Reply

Your email address will not be published. Required fields are marked *