bundle install problem: mysql.h is missing

前端 未结 12 1542
迷失自我
迷失自我 2020-12-07 17:02

in my mac OSX 10.6 32 bit, I can install mysql2 gem quite easily, but not in mini mac 10.6 64bit server.

I have installed MySQL 5.5.11 in troublesome server, while i

12条回答
  •  甜味超标
    2020-12-07 18:03

    Ok guys for me the solution was:

    $ sudo brew install mysql
    
    $ sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
      --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
      --with-mysql-include=/usr/local/mysql/include
    

    source: http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard

    OR :

    $sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- \
      --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
      --with-mysql-include=/usr/local/mysql/include
    

    If your mysql version is 64Bits

    After that i had a lot of problems because if i want to create the database:

    $: bundle exec rake db:reset
    

    i was receiving this error:

    dyld: lazy symbol binding failed: Symbol not found: _mysql_init
      Referenced from: /Users/workdreamer/Sites/cavortify/implementation/cavortify/mysql/ruby/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
      Expected in: flat namespace
    
    dyld: Symbol not found: _mysql_init
      Referenced from: /Users/workdreamer/Sites/cavortify/implementation/cavortify/mysql/ruby/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
      Expected in: flat namespace
    

    The solution is: On your gemfile add: gem "ruby-mysql"

    Ok, one day and a half to find the solution.

    Have a nice day!

提交回复
热议问题