我尝试使用 gem install pg
安装 pg gem,它返回:
gcc -dynamic -bundle -o pg_ext.bundle pg.o pg_connection.o pg_result.o -L. -L/Users/macuser/.rvm/rubies/ruby-1.9.2-p180/lib -L. -L/usr/local/lib -L/usr/local/Cellar/postgresql/9.1.2/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lpq -lpthread -ldl -lobjc
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file
collect2: ld returned 1 exit status
make: *** [pg_ext.bundle] Error 1
我已经试过了:
目前,我相信我的 mac 上有三个不同版本的 postgres。其中一个是一键安装程序,其他的是用 Brew 安装的。也许这就是问题所在?
我用这个安装 gem:
export CONFIGURE_ARGS="with-pg-include=/usr/local/Cellar/postgresql/9.0.3/include"
然后再次使用较新的版本:
export CONFIGURE_ARGS="with-pg-include=/usr/local/Cellar/postgresql/9.1.2/include"
同样的错误。
然后我尝试使用 ARCHFLAGS :
env ARCHFLAGS="-arch x86_64" gem install pg
还是一样的错误。不知道该怎么做。我也使用 RVM。也许这是一个原因?
我在哪里可以找到这个文件的更新版本? libssl.0.9.8.dylib
谢谢~
最佳答案
我强烈建议摆脱多重安装,只使用 EnterpriseDB 打包安装程序。 1是的,这似乎是您问题的根源。在一个到处都是随机安装垃圾的盒子上工作时,你会遇到其他问题。
关于ruby-on-rails - 由于 libssl.0.9.8.dylib 文件损坏,Snow Leopard 无法安装 pg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9354474/