dLobatog
dLobatog

Reputation: 1741

Postgres segmentation fault ruby gem

I am trying to run this project https://github.com/eLobato/cartodb-rb-client but apparently either my rvm is messed up or pg has a terrible bug. This is the error trace

/usr/bin/ruby1.8 -S bundle exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb"
/home/daniel/.rvm/gems/ruby-1.9.2-p290@cartodb-rb-client/gems/pg-0.11.0/lib/pg_ext.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

Aborted
rake aborted!
ruby -S bundle exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb" failed

Tasks: TOP => spec
(See full trace by running task with --trace)

The Segmentation fault line really bugs me a lot because I tried to reinstall pg with no avail. I am running Ubuntu 11.10 and I have installed both ruby 1.9.2 and 1.8.7

Any clue?

Upvotes: 3

Views: 3718

Answers (4)

Matt
Matt

Reputation: 903

I had this error too. Fixed it by removing all versions of Ruby installed on my system, then re-installing 1.9.3

Like so:

$ rvm remove all

$ rvm install ruby-1.9.3-p392

Upvotes: 2

mmrobins
mmrobins

Reputation: 13795

For me it seemed to be the version of the pg gem that was in my Gemfile.lock. I had 0.13.2 in there, and it just didn't seem to work on Ruby 1.9.3. I ran bundle update pg and got 0.14.0, and then things started working.

Upvotes: 0

Michael Granger
Michael Granger

Reputation: 1368

You're running a system Ruby 1.8.7 interpreter, but somehow loading a pg gem installed under Ruby 1.9.2 installed via rvm.

Ruby 1.8.7 and 1.9.2 have substantially different ABIs, so their extensions are not interchangeable.

Upvotes: 0

Jan Marek
Jan Marek

Reputation: 11200

Segmentation fault is, when program is accessing memory, which kernel don't expect (out of index, out of memory allocated block etc.).

What do you see, when you try:

ruby -S bundle --trace exec rspec "./spec/model/data_spec.rb" "./spec/model/metadata_spec.rb" "./spec/model/scopes_spec.rb" "./spec/client_spec.rb"

as backtrace advice to you?

Upvotes: -1

Related Questions