mysql gem fails to install using Ruby 1.9.1

Discussion in 'Ruby' started by Greg Donald, Mar 28, 2009.

  1. Greg Donald

    Greg Donald Guest

    I can't get the MySQL gem to install using Ruby 1.9.1.

    > gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

    Building native extensions. This could take a while...
    ERROR: Error installing mysql:
    ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb install mysql --
    --with-mysql-config=/usr/bin/mysql_config
    checking for mysql_ssl_set()... yes
    checking for mysql.h... yes
    creating Makefile

    make
    gcc -I. -I/usr/local/include/ruby-1.9.1/i686-linux
    -I/usr/local/include/ruby-1.9.1/ruby/backward
    -I/usr/local/include/ruby-1.9.1 -I. -DHAVE_MYSQL_SSL_SET
    -DHAVE_MYSQL_H -D_FILE_OFFSET_BITS=64 -I/usr/include/mysql
    -DBIG_JOINS=1 -fPIC -fno-strict-aliasing -fPIC -O2 -g -Wall
    -Wno-parentheses -o mysql.o -c mysql.c
    mysql.c:6:21: error: version.h: No such file or directory
    [...]
    make: *** [mysql.o] Error 1

    Gem files will remain installed in
    /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7 for inspection.
    Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/mysql-2.7/gem_make.out


    My Ruby is installed from source:

    > ruby -v

    ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]


    My MySQL is installed from packages:

    > dpkg -l|grep mysql

    ii libmysqlclient15-dev 5.1.30really5.0.75-0ubuntu9
    MySQL database development files
    ii libmysqlclient15off 5.1.30really5.0.75-0ubuntu9
    MySQL database client library
    ii mysql-client-5.0 5.1.30really5.0.75-0ubuntu9
    MySQL database client binaries
    ii mysql-common 5.1.30really5.0.75-0ubuntu9
    MySQL database common files


    My mysql_config exists and seems to work:

    > /usr/bin/mysql_config

    Usage: /usr/bin/mysql_config [OPTIONS]
    Options:
    --cflags [-I/usr/include/mysql -DBIG_JOINS=1 -fPIC
    -fno-strict-aliasing]
    --include [-I/usr/include/mysql]
    --libs [-Wl,-Bsymbolic-functions -rdynamic
    -L/usr/lib/mysql -lmysqlclient]
    --libs_r [-Wl,-Bsymbolic-functions -rdynamic
    -L/usr/lib/mysql -lmysqlclient_r]
    --socket [/var/run/mysqld/mysqld.sock]
    --port [0]
    --version [5.0.75]
    --libmysqld-libs [-Wl,-Bsymbolic-functions -rdynamic
    -L/usr/lib/mysql -lmysqld -lwrap -lrt]


    And finally, I have several version.h files:

    > locate version.h

    /usr/include/linux/version.h
    /usr/include/linux/dvb/version.h
    /usr/src/ruby-1.9.1-p0/version.h


    If there's a better place to ask about this, please let me know.


    Thanks,


    --
    Greg Donald
    http://destiney.com/
     
    Greg Donald, Mar 28, 2009
    #1
    1. Advertising

  2. Greg Donald

    7stud -- Guest

    Greg Donald wrote:
    > I can't get the MySQL gem to install using Ruby 1.9.1.
    >
    >> gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

    > Building native extensions. This could take a while...
    > ERROR: Error installing mysql:
    > ERROR: Failed to build gem native extension.


    sudo gem install??
    --
    Posted via http://www.ruby-forum.com/.
     
    7stud --, Mar 28, 2009
    #2
    1. Advertising

  3. Greg Donald

    Greg Donald Guest

    On Sat, Mar 28, 2009 at 7:58 AM, 7stud -- <> wrote:
    > Greg Donald wrote:
    >> I can't get the MySQL gem to install using Ruby 1.9.1.
    >>
    >>> gem install mysql -- --with-mysql-config=3D/usr/bin/mysql_config

    >> Building native extensions. =A0This could take a while...
    >> ERROR: =A0Error installing mysql:
    >> =A0 =A0 =A0 =A0 ERROR: Failed to build gem native extension.

    >
    > sudo gem install??


    No.

    > sudo su -


    # gem install mysql -- --with-mysql-config=3D/usr/bin/mysql_config



    --=20
    Greg Donald
    http://destiney.com/
     
    Greg Donald, Mar 28, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Géraud Contisouzas
    Replies:
    1
    Views:
    127
    Victor Grey
    Sep 13, 2006
  2. Mark Meijer

    mySQL Ruby Gem and MAMP mySQL

    Mark Meijer, Feb 2, 2008, in forum: Ruby
    Replies:
    3
    Views:
    189
    louis
    Feb 3, 2008
  3. Aj Mccauley

    ruby gem install mysql compile error

    Aj Mccauley, Mar 3, 2010, in forum: Ruby
    Replies:
    4
    Views:
    235
    AJ McCauley
    Mar 4, 2010
  4. Rajinder Yadav

    ruby-pg gem fails to install

    Rajinder Yadav, Nov 8, 2010, in forum: Ruby
    Replies:
    10
    Views:
    260
    Robert P.
    Dec 24, 2010
  5. Iñaki Baz Castillo
    Replies:
    1
    Views:
    167
    Iñaki Baz Castillo
    Feb 28, 2011
Loading...

Share This Page