• 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的人这么多,入门没这么烦。

  • 相关阅读:
    下载安装Apacheweb
    灵魂拷问第4篇:说一说从输入URL到页面呈现发生了什么?——解析算法篇
    灵魂拷问第3篇:说一说从输入URL到页面呈现发生了什么?——网络篇
    灵魂拷问第2篇:能不能说一说浏览器的本地存储?各自优劣如何?
    灵魂拷问第1篇:能不能说一说浏览器缓存?
    为什么是三次握手和四次挥手?
    http协商缓存VS强缓存
    版本管理之Git神器
    JavaScript 运行原理
    「动画演示」:变量提升别有一翻风味
  • 原文地址:https://www.cnblogs.com/jcli/p/2132206.html
Copyright © 2020-2023  润新知