mysql2 gem error w/ MariaDB: need development tools [solved]

Post here if you are a new Porteus member and you're looking for some help.
go2null
White ninja
White ninja
Posts: 25
Joined: 19 Aug 2014, 18:28
Distribution: LXDE-v3.0.1-i486.iso
Location: Canada

mysql2 gem error w/ MariaDB: need development tools [solved]

Post#1 by go2null » 20 Aug 2014, 22:18

I'm trying to install Redmine, and am getting stumped with installing the mysql2 gem.

Here is the pastebin from a fresh boot with the modules added manually.
And here is a summary.

Modules activated during boot time:

Code: Select all

/mnt/isoloop/porteus/base/000-kernel.xzm
/mnt/isoloop/porteus/base/001-core.xzm
/mnt/isoloop/porteus/base/002-xorg.xzm
/mnt/isoloop/porteus/base/003-lxde.xzm
/mnt/isoloop/porteus/base/04-firefox.xzm
/mnt/isoloop/porteus/base/06-libreoffice.xzm
/mnt/isoloop/porteus/modules/07-printing.xzm
Manually loaded modules

Code: Select all

git-1.8.4-i486-1.xzm
imagemagick-6.8.6_10-i486-1.xzm
	fftw-3.3.3-i486-1.xzm
	gcc-4.8.2-i486-1.xzm
	ilmbase-1.0.3-i486-1.xzm
	jasper-1.900.1-i486-3.xzm
	libmpc-0.8.2-i486-2.xzm
	openexr-1.7.1-i486-1.xzm
mariadb-5.5.37-i486-1_slack14.1.xzm
	libaio-0.3.109-i486-1.xzm
ruby-1.9.3_p484-i486-1_slack14.1.xzm
	libyaml-0.1.6-i486-1_slack14.1.xzm *
	tcl-8.6.1-i486-1.xzm
	tk-8.6.1-i486-1.xzm
The error (same occurs when running bundle install --without development test).

Code: Select all

guest@porteus:~$ sudo gem install mysql2 -v '0.3.16'
Fetching: mysql2-0.3.16.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
checking for ruby/thread.h... *** 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}/
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/ruby
/usr/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /usr/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
	from /usr/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
	from /usr/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
	from /usr/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
	from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /usr/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
	from /usr/lib/ruby/1.9.1/mkmf.rb:254:in `open'
	from /usr/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
	from /usr/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
	from /usr/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
	from extconf.rb:9:in `<main>'


Gem files will remain installed in /usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.16 for inspection.
Results logged to /usr/lib/ruby/gems/1.9.1/gems/mysql2-0.3.16/ext/mysql2/gem_make.out
guest@porteus:~$ 
Googling seems to indicate that libmysqlclient-dev is the solution on Debian/Ubuntu systems, however, I'm not sure how to proceed in that direction with Slackware/Porteus.

Any help appreciated. Thanks.
Last edited by go2null on 22 Aug 2014, 01:16, edited 1 time in total.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: mysql2 gem error with MariaDB: need development tools

Post#2 by fanthom » 21 Aug 2014, 07:52

maybe you could activate development module for porteus and check if that helps?
Please add [Solved] to your thread title if the solution was found.

go2null
White ninja
White ninja
Posts: 25
Joined: 19 Aug 2014, 18:28
Distribution: LXDE-v3.0.1-i486.iso
Location: Canada

mysql2 gem error with MariaDB: need development tools [solve

Post#3 by go2null » 22 Aug 2014, 01:15

fanthom wrote:maybe you could activate development module for porteus and check if that helps?
That fixed it for mysql2.
Thanks!

Post Reply