懒符号绑定失败

时间:2016-06-15 07:00:33

标签: ruby-on-rails ruby bundler rbenv

使用OS X Yosemite,对于现有的Rails项目,我安装了ruby版本2.3.0(使用rbenv),安装了捆绑包,捆绑和重新散列。现在,当我尝试使用bundle exec rails s启动rails服务器时,我收到以下错误。

我不完全确定在安装ruby 2.3.0之后发生了什么,因为这实际上发生在前一段时间,因为我无法让它及时工作,我现在换回旧的ruby版本。从那以后,我一直在寻找一个解决方案。这里和其他网站的类似问题的解决方案没有解决这个问题。如下所述,运行gem pristine --all的最明显的解决方案并不能解决问题。我真的希望你能指导我,非常感谢!

-> bundle exec rails s
Ignoring binding_of_caller-0.7.2 because its extensions are not built.  Try: gem pristine binding_of_caller --version 0.7.2
Ignoring byebug-9.0.5 because its extensions are not built.  Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built.  Try: gem pristine debug_inspector --version 0.0.2
Ignoring pg-0.18.4 because its extensions are not built.  Try: gem pristine pg --version 0.18.4
Ignoring puma-3.4.0 because its extensions are not built.  Try: gem pristine puma --version 3.4.0
Ignoring sqlite3-1.3.11 because its extensions are not built.  Try: gem pristine sqlite3 --version 1.3.11
Ignoring websocket-driver-0.6.4 because its extensions are not built.  Try: gem pristine websocket-driver --version 0.6.4
dyld: lazy symbol binding failed: Symbol not found: _rb_data_object_alloc
  Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/pg-0.18.4/lib/pg_ext.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_data_object_alloc
  Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/pg-0.18.4/lib/pg_ext.bundle
  Expected in: flat namespace

更新

这是对答案建议的更新。所有提到的宝石都有以下错误。

gem pristine binding_of_caller --version 0.7.2
ERROR:  While executing gem ... (Gem::Exception)
    Failed to find gems ["binding_of_caller"] = 0.7.2

4 个答案:

答案 0 :(得分:2)

由于我已经尝试了很多来摆脱这个错误,我无法确切地说出最终解决了什么 - 但在解决方案的路上我发现我可能已经通过github pull和homebrew安装了rbenv。假设这可能导致未安装的宝石(在特定的ruby版本下)声称已安装,这似乎是一种可能的解释。在运行rm -rf ~/.rbenv之后,在安装brew的rbenv版本的同时,清除了“忽略...因为它的原生......”,同时重新安装了宝石。

通过重置正确的配置路径解决了pg应用的安装问题:

bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

然后运行bundle

答案 1 :(得分:0)

尝试按照错误消息中的提示进行操作:

gem pristine binding_of_caller --version 0.7.2
gem pristine byebug --version 9.0.5
gem pristine debug_inspector --version 0.0.2
gem pristine pg --version 0.18.4
gem pristine puma --version 3.4.0
gem pristine sqlite3 --version 1.3.11
gem pristine websocket-driver --version 0.6.4

答案 2 :(得分:0)

尝试使用libpq-dev lib

Install Postgresql

看起来你没有psql驱动程序

答案 3 :(得分:0)

调用者绑定的文档说明才能使用,直到ruby 2.1

  

仅适用于MRI Ruby 1.9.2,1.9.3,2.0,2.1和RBX(Rubinius)

REF: https://github.com/banister/binding_of_caller#user-content-binding_of_caller