Bug 7162 - Ruby gem mysql2 fails to install with mariaDB
Summary: Ruby gem mysql2 fails to install with mariaDB
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: i586 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: Triaged, UPSTREAM
Depends on:
Blocks:
 
Reported: 2012-08-24 22:43 CEST by Alexandr Bezenkov
Modified: 2013-08-30 16:24 CEST (History)
2 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Alexandr Bezenkov 2012-08-24 22:43:45 CEST
Installing mysql2 gem fails with message about mysql.h not found.

Steps to reproduce:
1. Install RVM with "curl -L https://get.rvm.io | bash -s stable"
2. Execute "/bin/bash -l"
3. Install Ruby with "rvm install ruby-1.9.3"(may take some time, has prerequisites)
4. Try to install mysql2 gem with "gem install mysql2"

I tried the above steps with Debian Squeezy and Fedora 17, error is present only when mysql-devel is absent, installing mysql-devel solves problem, however Mageia 2 does not have mysql and mariadb-devel does not help nevertheless after installing it mysql.h is under /usr/unclude/mysql as in other two distros.
Comment 1 Dave Hodgins 2012-08-24 23:55:52 CEST
$ urpmf '/usr/include/mysql/mysql.h'|sort -u
lib64mariadb-devel:/usr/include/mysql/mysql.h
libmariadb-devel:/usr/include/mysql/mysql.h

CC: (none) => davidwhodgins

Comment 2 Manuel Hiebel 2012-08-25 13:38:23 CEST
so the issue can be where ? (if there is one), sorry for this case I really don't see
Comment 3 Dave Hodgins 2012-08-26 09:37:21 CEST
Since the system is i586 the package libmariadb-devel needs to
to be installed, as it contains the file
/usr/include/mysql/mysql.h

I posted the comment as I did, to make it clear how I found out
which package is needed.  As the file is provided, I'll go ahead
and close this bug as invalid.

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Comment 4 Alexandr Bezenkov 2012-08-26 19:27:50 CEST
Sorry for mistyping, with Mageia I installed not mariadb-devel, but libmariadb-devel and as I said before after installing it mysql.h is in /usr/unclude/mysql. However I still get "mysql.h is missing" nevertheless mysql.h is present.

Status: RESOLVED => REOPENED
Resolution: INVALID => (none)

Comment 5 Samuel Verschelde 2013-08-29 11:53:03 CEST
Hi, thanks for reporting this bug.
Assigned to the package maintainer for mariadb, who can maybe see why mysql.h is not found during gem install.

Keywords: (none) => Triaged
CC: (none) => stormi
Assignee: bugsquad => alien
Source RPM: (none) => mariadb

Comment 6 AL13N 2013-08-30 14:58:05 CEST
in the past, there was a bug which installed mysql.h in

/usr/include/mysql/mysql/


perhaps this is related?
(i note that it's likely that other distro's still ship it in the wrong place)

i don't know anything about ruby, but in C, it could be like this:

gcc -I /usr/include/mysql -o foo foo.c



and in foo.c:

#include <mysql/mysql.h>

...

this would have mysql.h looking in /usr/include/mysql/mysql/

and in the compiler, setting include path to /usr/include/ would fix the problem.

i'm afraid this will have to be assigned to the ruby mysql maintainer for follow up.

i donno how ruby stuff works, but if it's in C, it would be nice to have logs detailing the exact errors and the code that calls for the header file. (is this a configure thing? or during build?) where is the include path file detailed? perhaps changing this, would fix it?

perhaps the maintainer can talk this through with upstream ruby people to see if it could look for both paths?
Comment 7 Samuel Verschelde 2013-08-30 15:02:58 CEST
Summary: no obvious bug in mariadb packaging, maybe a bug in ruby, definitely a need for insight from someone who knows ruby.

Assigning to ruby maintainer. Please just re-assign to bugsquad if I was wrong.

Assignee: alien => pterjan
Source RPM: mariadb => ruby

Comment 8 Pascal Terjan 2013-08-30 15:11:46 CEST
This is not related to our ruby package (as reporter builds his own ruby from scratch).

Anyway this is a ruby module, written in C, that is not installed from our repository.

As this is using upstream rvm + upstream mysql2, the bug should probably be reported to mysql2.

Source RPM: ruby => (none)

Comment 9 Samuel Verschelde 2013-08-30 16:24:02 CEST
So, this is an upstream mysql2 bug probably. See comment #6 for possible explanation: in mariadb path to mysql.h has been fixed, but other distros might still use the old wrong path, /usr/include/mysql/mysql/

If you are not mistaken, mysql2 should make sure it builds with both old and new path.

Keywords: (none) => UPSTREAM
Status: REOPENED => RESOLVED
Resolution: (none) => INVALID
Assignee: pterjan => bugsquad


Note You need to log in before you can comment on or make changes to this bug.