简体   繁体   English

pg gem Trace/BPT 陷阱:MAC OS X lion 上出现 5 个错误

[英]pg gem Trace/BPT trap: 5 error on MAC OS X lion

I recently upgraded my snow leopard to lion and in one of my apps i get我最近将我的雪豹升级为狮子,在我的一个应用程序中我得到了

=> Booting WEBrick
=> Rails 3.0.4 application starting in development on http://0.0.0.0:4000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-08-16 17:47:27] INFO  WEBrick 1.3.1
[2011-08-16 17:47:27] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin11.0.0]
[2011-08-16 17:47:27] INFO  WEBrick::HTTPServer#start: pid=3460 port=4000
Trace/BPT trap: 5

the app quits and there is no other output, it does run with sqlite3 as the db gem.该应用程序退出并且没有其他 output,它确实使用 sqlite3 作为 db gem 运行。 I commented all other gems but this one and still got the erros.我评论了所有其他宝石,但这个宝石仍然有错误。 i see this error not when the app is loading but when it tries to answer the first request.我不是在加载应用程序时看到此错误,而是在它尝试回答第一个请求时看到此错误。

Anyone knows another gem to connect to postgresql or any workaround?任何人都知道另一个连接到 postgresql 的宝石或任何解决方法?

EDIT: OK here is some clarification.编辑:好的,这里有一些澄清。

I started this project on snow leopard and it worked perfectly, I had rvm installed, the pg gem, webrick and ruby 1.9.2-p180, I upgraded to lion and keep working on other projects, when the time come to update this project, i got the Trace/BPT trap: 5 error, and the server gives no other clue of what is going on.我在雪豹上开始了这个项目,它运行良好,我安装了 rvm,pg gem,webrick 和 ruby 1.9.2-p180,我升级到 lion 并继续从事其他项目,到时候更新这个项目,我得到了Trace/BPT trap: 5错误,并且服务器没有提供任何其他线索来说明正在发生的事情。 My guess is that this is something very low level and the ruby interpreter does not even gets the chance to show the exception and this message is STDIO related.我的猜测是这是非常低的级别,ruby 解释器甚至没有机会显示异常,并且此消息与 STDIO 相关。

Trying to fix this i have: reinstalled rvm, installed ruby 1.9.2-p290, reinstalled postgresql, deleted and rebuild the gemset for the project, installed mongrel and still the app crashes web it gets the first web request, note that it does work on the rails console. Trying to fix this i have: reinstalled rvm, installed ruby 1.9.2-p290, reinstalled postgresql, deleted and rebuild the gemset for the project, installed mongrel and still the app crashes web it gets the first web request, note that it does work在导轨控制台上。

EDIT 2: It is now running on ruby-1.8.7-352 so it seem is a 1.9.2 related issue on MAC OS X 10.7编辑 2:它现在在 ruby-1.8.7-352 上运行,所以它似乎是 MAC OS X 10.7 上的 1.9.2 相关问题

EDIT 3: Is a XCODE 4.1 issue that has to do with llvm compiler and the "optimization" it does when there is need to build with native extension.编辑 3:是一个 XCODE 4.1 问题,它与 llvm 编译器和它在需要使用本机扩展构建时所做的“优化”有关。 The solution is to install a compatible Xcode, more info can be found at the RVM site.解决方案是安装兼容的 Xcode,更多信息可以在 RVM 站点上找到。

I fixed this - it was a simple issue of a missing "gem 'pg'" in my Gemfile.我解决了这个问题 - 这是一个简单的问题,即我的 Gemfile 中缺少“gem 'pg'”。 For various reasons it had been commented out.由于各种原因,它已被注释掉。

Try the following:尝试以下操作:

gem uninstall pg
env ARCHFLAGS="-arch x86_64" gem install pg

I had the same problem and this solution worked for me.我有同样的问题,这个解决方案对我有用。 I am running Ruby 1.9.2 p136, Rails 3.0.1, Postgresql 9.0.4 and the pg gem version 0.11.0.我正在运行 Ruby 1.9.2 p136、Rails 3.0.1、Postgresql 9.0.4 和 pg gem 版本 0.11.0。

I am of course assuming that you have also correctly configured your Gemfile to use the 'gem pg', and that you don't have any other database gems active in there, and that you have a working database that you can access with psql coupled with a properly configured database.yml file in rails.我当然假设您还正确配置了 Gemfile 以使用“gem pg”,并且您没有任何其他处于活动状态的数据库 gem,并且您有一个可以使用 psql 耦合访问的工作数据库在 rails 中使用正确配置的 database.yml 文件。

Hope this works for you, Erik希望这对你有用,埃里克

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM