问题在安装PG宝石正常 [英] Problem installing pg gem properly
问题描述
我有一个Rails应用程序,我想获得在Amazon EC2实例上运行。这个应用程序已经得到很好的测试在各种Linux,OS X和Windows系统。
在EC2服务器,我已经建立了PostgreSQL的9,从源头。起初,PG创业板不会安装,但我建立它与下面的命令:
创业板安装PG - --with-pgsql的-LIB =在/ usr /本地/ pgSQL的/ lib目录--with-pgsql的-配置=在/ usr /本地/ pgsql里/斌/ pg_config
这似乎是建立正常。然而,当我运行rake任务,如'耙分贝:迁移我收到以下错误:
耙中止!
libpq.so.5:无法打开共享对象文件:没有这样的文件或目录 - /home/ec2-user/.rvm/gems/ruby-1.8.7-p334/gems/pg-0.11.0/lib/pg_ext。所以
从错误信息和您的查找命令输出的描述,它可能是的/ usr /本地/ pgSQL的/ lib目录
不在路漫漫其库动态链接器的搜索。尝试添加该目录为 /etc/ld.so.conf中
(或类似),或者设置 LD_LIBRARY_PATH
将其列入在运行前,耙
。
I have a rails app that I am trying to get running in an Amazon EC2 instance. This app has been tested properly on various Linux, OS X and Windows systems.
On the EC2 server, I have built PostgresSQL 9 from source. At first, the 'pg' gem wouldn't install but I built it with the following command:
gem install pg -- --with-pgsql-lib=/usr/local/pgsql/lib --with-pgsql-config=/usr/local/pgsql/bin/pg_config
This seemed to build properly. However, when I run a rake task, such as 'rake db:migrate' I get the following error:
rake aborted!
libpq.so.5: cannot open shared object file: No such file or directory - /home/ec2-user/.rvm/gems/ruby-1.8.7-p334/gems/pg-0.11.0/lib/pg_ext.so
From the error message and your description of your 'find' command output, it's possible that /usr/local/pgsql/lib
is not in the path the dynamic linker searches for its libraries. Try adding that directory to /etc/ld.so.conf
(or similar), or set LD_LIBRARY_PATH
to include it before you run rake
.
这篇关于问题在安装PG宝石正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!