启动时出现 DYLD 错误 mongodb

DYLD error when starting up mongodb

我安装 mongo 有:

brew install mongodb

我创建了数据目录:

/data/dir

我包含 mongod 路径 (which mongod --> /opt/local/bin/mongod):

export PATH=$PATH:/opt/local/bin/mongod

我试过了 运行 mongod:

mongod

并得到了这样的回应:

dyld: lazy symbol binding failed: Symbol not found: __ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE
  Referenced from: /opt/local/bin/mongod
  Expected in: /opt/local/lib/libpcrecpp.0.dylib

dyld: Symbol not found: __ZN7pcrecpp2RE4InitERKSsPKNS_10RE_OptionsE
  Referenced from: /opt/local/bin/mongod
  Expected in: /opt/local/lib/libpcrecpp.0.dylib

这个错误是怎么回事?我该如何进行?

问题是我将路径设置到了错误的目录

Brew 将软件包安装到 /usr/local/bin 中,那里有一个符号链接 mongod@ -> homebrew's cellar

所以,相反,我 运行 /usr/local/bin/mongod 然后它开始正常。