Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8444773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:29:03+00:00 2026-06-10T09:29:03+00:00

On a CentOS 5.7 box, I’m having trouble installing the newest version of the

  • 0

On a CentOS 5.7 box, I’m having trouble installing the newest version of the mysql2 gem; it’s not finding errmsg.h:

/usr/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... no
checking for mysql_query() in -lmysqlclient... yes
checking for mysql.h... no
checking for mysql/mysql.h... yes
checking for errmsg.h... no
-----
errmsg.h is missing.  please check your installation of mysql and try again.
-----
*** extconf.rb failed ***

The mysql header files exist at /usr/include/mysql. An older version of the gem exists on the server, so it must have been built successfully at one point.

Note that it fails on a check for mysql.h, but succeeds on mysql/mysql.h. However, it doesn’t repeat this for errmsg.h. By this I’m guessing that it’s not looking at /usr/include, but I’m not sure.

I’ve dug into the extconf.rb source code and discovered that it’s using the have_header method to locate the header files. I debugged the execution to find out that it’s looking for a relative path of “mysql/errmsg.h”. But I haven’t found any documentation that explains how it expands that into an absolute path.

Where & how does have_header locate its header files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:29:05+00:00Added an answer on June 10, 2026 at 9:29 am

    I believe I’ve found an answer.

    It appears that have_header looks at the system include path. If the relevant environment variables are not set, the default include paths are /usr/local/include and /usr/include.

    If you want to set them manually, you would do something like:

    export C_INCLUDE_PATH=/usr/include/mysql/
    

    That’s true even if you’re compiling a C++ program, if the header file is a C file. If, on the other hand, your header file is C++, not C, you would do:

    export CPLUS_INCLUDE_PATH=/usr/include/mysql
    

    Of course, you found the work-around, which is to include dir_config('mysql') in your extconf.rb. That enables you to use the --with-mysql-include option and supply the path manually.

    Here’s my source: http://www.network-theory.co.uk/docs/gccintro/gccintro_23.html

    And here’s a more general version of the same question (with answers): How to add a default include path for gcc in linux?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some problems installing BlogEngine.NET onto my CentOS mod_mono 2.8 (mono 2.8.1) box. The
EDIT: This seems to work on my CentOS machine but not my Ubuntu box.
Ok. I have a dedicated box running centOS 5, it has cPanel installed to
I have a windows box and a VM running CentOS. Does anyone happen to
On my Centos 6.2 I have this bash script: [le_me]$ cat get.nb #! /bin/bash
I have a CentOS 5.8 server and am planning to install a later version
I'm trying to run a .jar file on my centos box, but it says
On my CentOS 5.2 box the XEN virtual machine configuration files have to be
I have a Red Had Enterprise Linux 5 and a CentOS 5 box, both
I set Centos 6.3 up on a Rackspace box, using a static IP address

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.