Rails,Postgres:dyld:惰性符号绑定失败:找不到符号:_PQresultMemorySize [英] Rails, Postgres: dyld: lazy symbol binding failed: Symbol not found: _PQresultMemorySize
本文介绍了Rails,Postgres:dyld:惰性符号绑定失败:找不到符号:_PQresultMemorySize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Mac上使用postgres创建新的rails-app(6.0.2)无法使其运行。
creating a new rails-app (6.0.2) with postgres, on mac, could not get it to run.
在应用启动时出现此错误:
Getting this error on app start:
dyld: Symbol not found: _PQresultMemorySize
Referenced from: /Users/dev/.rvm/gems/ruby-2.5.7/gems/pg-1.2.2/lib/pg_ext.bundle
Expected in: /usr/lib/libpq.5.dylib
这似乎与dyld:懒惰的符号绑定失败:未找到符号:_PQresultMemorySize-Rails ,
但是该怎么办?
我以前在rails v6.0.1上使用过的rails应用程序使用相同的postgres gem'pg','> = 0.18','< 2.0’运行正常
My previous rails apps, on rails v6.0.1, also with the same postgres gem 'pg', '>= 0.18', '< 2.0'
are running just fine
推荐答案
我发现以下解决方法。它在pg_ext.bundle中将共享库的路径硬编码为:
I found the following workaround. It hardcodes the path to the shared library in the pg_ext.bundle:
install_name_tool -change libpq.5.dylib /Library/PostgreSQL/12/lib/libpq.5.12.dylib pg_ext.bundle
这篇关于Rails,Postgres:dyld:惰性符号绑定失败:找不到符号:_PQresultMemorySize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文