arr*_*l12 7 ruby gem ruby-on-rails pg rails-postgresql
我正在尝试为Ruby安装pg(PostreSQL)gem.我收到此错误:
postgres/9.2-pgdg/bin/64/pg_config
Using config values from /location/to/install/postgres/9.2-pgdg/bin/64/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... no
Your PostgreSQL is too old. Either install an older version of this gem or upgrade your database.
*** 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.
Run Code Online (Sandbox Code Playgroud)
PostgreSQL版本:postgres(PostgreSQL)9.2.3
OS:solaris 10
我也尝试过:
gem install pg -- --with-pgsql-lib=/location/of/install/postgres/9.2-pgdg/lib/64/ --with-pg-config=/location/of/install/postgres/9.2-pgdg/bin/64/pg_config
Run Code Online (Sandbox Code Playgroud)
我不知道为什么会出现这个错误,我在Google上找不到任何有用的信息.
任何帮助是极大的赞赏.
安装数据库客户端、gem 和使用它可能会出现很多问题。
我通常从源代码安装 PostgreSQL,而不是从发行版安装。那时我知道我拥有所有源代码并且确切地知道东西安装在哪里。这在安装与客户端驱动程序通信的 gem 时非常重要。
我还依赖于从源代码安装 Ruby,要么自己直接安装,要么使用 rbenv 或 RVM(如果它在我的开发盒之一上)。然后我也直接安装 pg gem,使用gem install pg; 在安装语言时,我有过太多使用发行版的糟糕经历,所以我选择了老派的方式。
我编写了一个在 Mac OS 系统上使用的小脚本,我发现它对我的 CentOS Linux 机器很有用:
#!/bin/sh -x 路径=/Library/PostgreSQL/9.2/bin:$PATH 宝石安装PG
我根据 PostgreSQL 的安装位置调整 PATH 添加,它似乎可以解决问题。我也使用了更长、更“全面”的选项,但这似乎也有效。
问题是安装程序需要从 pg_config 可执行文件中挖掘安装信息,并且能够找到 pg_config 来解决问题。
| 归档时间: |
|
| 查看次数: |
2110 次 |
| 最近记录: |