在 rvm 下使用 postgres.app 要求 pg 时出错 [英] Error requiring pg under rvm with postgres.app
本文介绍了在 rvm 下使用 postgres.app 要求 pg 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 OS X (10.8.3) 上使用 Postgres.app.我已经修改了我的 PATH
,以便应用程序的 bin
文件夹位于所有其他文件夹之前.
I'm using Postgres.app on OS X (10.8.3). I have modified my PATH
so that the bin
folder for the app is before all others.
Rammy:~ phrogz$ which pg_config
/Applications/Postgres.app/Contents/MacOS/bin/pg_config
我已经安装了 rvm 并且可以毫无错误地安装 pg gem,但是当我需要它时,我收到一个错误:
I have rvm installed and can install the pg gem without error, but when I go to require it I get an error:
Rammy:~ phrogz$ gem -v
1.8.25
Rammy:~ phrogz$ gem install pg
Fetching: pg-0.15.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed pg-0.15.1
1 gem installed
Rammy:~ phrogz$ ruby -v -e "require 'pg'"
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0]
/Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': dlopen(/Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg_ext.bundle, 9): Library not loaded: @executable_path/../lib/libssl.1.0.0.dylib (LoadError)
Referenced from: /Applications/Postgres.app/Contents/MacOS/lib/libpq.dylib
Reason: image not found - /Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg_ext.bundle
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/phrogz/.rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/lib/pg.rb:4:in `<top (required)>'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/phrogz/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from -e:1:in `<main>'
我需要做什么才能正确安装 pg
gem?
What do I need to do to get the pg
gem properly installed?
推荐答案
这对我有用:
sudo env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config
只需仔细检查/Applications/Postgres93.app.. 路径是否存在.
Just double check that the /Applications/Postgres93.app.. path exists for you.
这篇关于在 rvm 下使用 postgres.app 要求 pg 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文