1. mysql errors

    Mysql problems during the migration to rails 2.x.

    Rails 2.x no longer contains the “mysql” adapter. Fine, then I just install it from rubygems:

    # sudo gem install mysql

    But it fails with

    *** extconf.rb failed ***

    First fix: tell the gem installer where my mysql installation sleeps:

    # sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

    This time it installs fine, except that I get errors when I try to use it:

    LoadError: dlsym(0x1412860, Init_mysql): symbol not found - /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle

    After some research, the problem is that I installed the 64bit version of mysql and the gem expects the 32bit version. Went to the downloads page, installed x86 instead of x86_64 (warning : this will destroy all your databases !!) and retried:

    # sudo gem uninstall mysql
    # sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    # irb
    irb(main):001:0> require 'rubygems'
    => true
    irb(main):002:0> require 'mysql'
    => true
    

    Hope that helps someone with the same kind of setup.

    Gaspard Bucher

    comments

    1. leave a comment