[英]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.