`
贝特虫子
  • 浏览: 154122 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

Windows 对 Ruby 安装 PostgreSQL 驱动程序

    博客分类:
  • ruby
阅读更多
   1.  安装 PostgreSQL 适配器驱动程序
      详细步骤参见:http://glauche.de/2007/12/21/installing-native-postgres-gem-for-ruby/
      运行 gem install ruby-postgres,在列表中选择对应的平台(mswin32)进行安装,如:

      D:\source\Personal\lnj\tour>gem install ruby-postgres

          Bulk updating Gem source index for: http://gems.rubyforge.org

          Select which gem to install for your platform (i386-mswin32)

          1. ruby-postgres 0.7.1.2006.04.06 (ruby)

          2. ruby-postgres 0.7.1.2006.04.06 (mswin32)

          3. ruby-postgres 0.7.1.2006.04.05 (mswin32)

          4. ruby-postgres 0.7.1.2006.04.05 (ruby)

          5. Skip this gem

          6. Cancel installation

          > 2

          Successfully installed ruby-postgres-0.7.1.2006.04.06-mswin32

          Installing ri documentation for ruby-postgres-0.7.1.2006.04.06-mswin32...

          Installing RDoc documentation for ruby-postgres-0.7.1.2006.04.06-mswin32...

         

   2. 测试驱动程序
      在控制台中运行 irb,输入命令 require "postgres",如果返回 true,说明链接成功,如果出现错误:
          * 报错:"没有找到 libpq.dll,因此这个应用程序未能启动",将 C:\Program Files\PostgreSQL\8.3\bin\libpq.dll 复制到 C:\ruby\bin。
          * 报 错:"无法定位序数 284 于动态链接库 SSLEAY32.dll 上",可能是 ruby 所用 SSLEAY32.dll 的版本号低于 postgresql 使用的,将 C:\Program Files\PostgreSQL\8.3\bin\libeay32.dll 和 ssleay32.dll 替换 C:\ruby\bin 下同名文件。
          * 报错:"没有找到 xxx.dll,因此这个应用程序未能启动",将 C:\Program Files\PostgreSQL\8.3\bin\xxx.dll 复制到 C:\ruby\bin。
          * 可能需要复制下列文件:
                o libeay32.dll 替换
                o ssleay32.dll 替换
                o libpq.dll
                o libintl3.dll
                o libiconv2.dll
                o krb5_32.dll
                o comerr32.dll
                o k5sprt32.dll
                o gssapi32.dll
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics