zoukankan      html  css  js  c++  java
  • rails ubuntu环境下mysql适配器安装

    本机环境:ubuntu9.10  ruby1.87  rails 2.2.2  mysql 5.1        


           step 1:
              从http://www.tmtm.org/en/mysql/ruby/下载 mysql-ruby-2.X.tar.gz
         
          
    step 2:
               解压后,cd 到当前目录,运行 : ruby extconf.rb
               如果报错:
              
    no such file to load -- mkmf (LoadError)
               from extconf.rb:1
               则运行 :sudo apt-get install ruby1.8-dev

          
    step 3:
              
    运行 :  ruby extconf.rb --with-mysql-dir=/usr/share/mysql(注:你本机mysql安装目录)
               如果报错:
              
    -----------------------------------------------------------------------------------------------------
               checking for mysql_query() in -lmysqlclient... no
               checking for main() in -lm... yes
               checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lz... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lsocket... no
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lnsl... yes
    checking for mysql_query() in -lmysqlclient... no
    checking for main() in -lmygcc... no
    checking for mysql_query() in -lmysqlclient... no
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.

    Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby1.8
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mygcclib
        --without-mygcclib
        --with-mysqlclientlib
        --without-mysqlclientlib

    -----------------------------------------------------------------------------------------------------

    则运行 : sudo apt-get install libmysqlclient15-dev

    step 4 :
          运行 : make

    step 5 :
         运行 : make install


    ps:上次用django开发,mysql这块也是配置了半天。哎,难怪用j2ee的人这么多,入门没这么烦。

  • 相关阅读:
    bzoj2055: 80人环游世界(有源汇上下界可行最小费用流)
    bzoj千题计划158:bzoj2406: 矩阵(有源汇上下界可行流)
    bzoj1220:[HNOI2002]跳蚤
    [USACO4.3]逢低吸纳Buy Low, Buy Lower
    hdu 3488 Tour
    [网络流24题] 餐巾计划
    zkw费用流模板
    [网络流24题] 最长k可重区间集
    bzoj千题计划156:bzoj1571: [Usaco2009 Open]滑雪课Ski
    Codeforces Round #449 C. Willem, Chtholly and Seniorious (Old Driver Tree)
  • 原文地址:https://www.cnblogs.com/jcli/p/2132206.html
Copyright © 2011-2022 走看看