简体   繁体   English

找不到rails postgres zsh符号:_rb_eEncCompatError(LoadError)

[英]rails postgres zsh Symbol not found: _rb_eEncCompatError (LoadError)

I have been troubleshooting a very odd issue in my local development rails setup for some time now. 我已经对本地开发环境中的一个非常奇怪的问题进行了一段时间的故障排除。 While I can not track exactly when it started I wanted to post this to see if anyone else has seen this issue or has ideas on how to fix it. 虽然我无法确切跟踪它的开始时间,但我想发布此消息,以查看是否有人发现了此问题或有解决此问题的想法。

How to duplicate this error. 如何复制此错误。 I startup iterm2 (zsh) and in the first tab in my project I run rails s to start the server. 我启动iterm2(zsh),然后在项目的第一个选项卡中运行rails s来启动服务器。 As most developers do, I hit cmd+t to open a new tab and when I attempt to run rails c the rails console this error displays. 和大多数开发人员一样,我按cmd + t打开一个新选项卡,当我尝试在rails c上运行rails c将显示此错误。 It's like I am restricted to a single tab. 就像我只能使用一个标签一样。 I have found little research or direction online as to where to go with this issue and I am hoping someone out there could point me in the right direction. 对于此问题的解决方案,我在网上几乎找不到研究或方向,我希望外面有人可以指出正确的方向。

It appears to be failing on the PG gem and I already verified I am running the latest version. PG gem似乎失败了,我已经验证我正在运行最新版本。

My .zshrc file: 我的.zshrc文件:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
export PATH=/Users/chrishough:/Users/chrishough/.rvm/gems/ruby-1.9.3-head/bin:/Users/chrishough/.rvm/gems/ruby-1.9.3-head@global/bin:/Users/chrishough/.rvm/rubies/ruby-1.9.3-head/bin:/Users/chrishoug$

Here is a copy of the exact error that pops up in terminal. 这是终端中弹出的确切错误的副本。

/Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg_ext.bundle: dlopen(/Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg_ext.bundle, 9): Symbol not found: _rb_eEncCompatError (LoadError)
  Referenced from: /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg_ext.bundle
  Expected in: flat namespace
 in /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg_ext.bundle - /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg_ext.bundle
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/pg-0.14.1/lib/pg.rb:4
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /Users/chrishough/Huedio/Code/Profiles/config/application.rb:13
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/railties-3.2.11/lib/rails/commands.rb:39:in `require'
    from /Users/chrishough/.rvm/gems/ruby-1.9.3-p374@My-Application-Profiles/gems/railties-3.2.11/lib/rails/commands.rb:39
    from script/rails:6:in `require'
    from script/rails:6

Thank you so much for your help everyone. 非常感谢大家的帮助。 Have a great weekend. 周末愉快。

UPDATE 更新

From @crazymykl I updated my .zshrc config to look like this and the error appears to have gone away. 我从@crazymykl更新了.zshrc配置,使其看起来像这样,错误似乎已经消失了。

# RUBY DEVELOPMENT
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
# export PATH=/Users/chrishough:/Users/chrishough/.rvm/gems/ruby-1.9.3-head/bin:/Users/chrishough/.rvm/gems/ruby-1.9.3-head@global/bin:/Users/chrishough/.rvm/rubies/ruby-1.9.3-head/bin:/Users/chrishoug$

Thoughts? 有什么想法吗?

The root of your issue is that your .zshrc refers to ruby-1.9.3-head , and it's looking at ruby-1.9.3-p374 to find the pg_ext.bundle. 问题的根源是您的.zshrc指向ruby-1.9.3-head ,并且正在查看ruby-1.9.3-p374来找到pg_ext.bundle。 Mismatched versions cause all sorts of oddness. 版本不匹配会导致各种奇怪情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到符号:Rails 5上的_rb_cFixnum - Symbol not found: _rb_cFixnum on Rails 5 为什么启动导轨时RMagick失败并显示Symbol找不到LoadError? - Why does RMagick fail with Symbol not found LoadError when starting rails? LoadError:dlopen(digest / sha1.bundle):找不到符号:_rb_Digest_SHA1_Finish - LoadError: dlopen(digest/sha1.bundle): Symbol not found: _rb_Digest_SHA1_Finish Rails、Postgres:dyld:惰性符号绑定失败:找不到符号:_PQresultMemorySize - Rails, Postgres: dyld: lazy symbol binding failed: Symbol not found: _PQresultMemorySize rails s - > dyld:懒符号绑定失败:未找到符号:_rb_intern2 - rails s -> dyld: lazy symbol binding failed: Symbol not found: _rb_intern2 找不到符号:_SSLv2_client_method(LoadError) - Symbol not found: _SSLv2_client_method (LoadError) 使用ruby-debugger抛出的Rails'找不到符号:_ruby_current_thread(LoadError)' - Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)' Mac OS X Snow Leopard 上的 Rails:mysql2.bundle dlsym - 找不到符号 (LoadError) - Rails on Mac OS X Snow Leopard: mysql2.bundle dlsym - Symbol not found (LoadError) ZSH:找不到命令:rails - ZSH: Command Not Found: rails mysql2 gem在OSX上加载Rails env时出错:“未找到符号:_rb_prohibit_interrupt” - Error with mysql2 gem loading Rails env on OSX: “Symbol not found: _rb_prohibit_interrupt”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM