简体   繁体   中英

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. 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?

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. 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.

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.

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

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. The solution is to install a compatible Xcode, more info can be found at the RVM site.

I fixed this - it was a simple issue of a missing "gem 'pg'" in my Gemfile. 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.

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.

Hope this works for you, Erik

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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