Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symbol lookup error since upgrading to Ruby 2.2.0

I got this error, since upgrading to 2.2.0, only happened when a http request sent to puma:

puma 2.10.2 (tcp://0.0.0.0:22555): symbol lookup error: 
  /usr/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0/do_postgres-0.10.14/do_postgres/do_postgres.so: 
  undefined symbol: rb_thread_select

What are the cause and how to fix this?

Downgrading to 2.1.5 fixes this problem anyway.

like image 223
Kokizzu Avatar asked Jan 21 '15 08:01

Kokizzu


Video Answer


1 Answers

The pg gem prior to version 0.14.1 uses the method rb_thread_select. This method was removed in Ruby 2.2. According to their history file, version 0.15.0 released in March 2013 does not use it anymore:

== v0.15.0 [2013-03-03] Michael Granger <[email protected]>

[...]

Enhancements:

- Make use of rb_thread_fd_select() on Ruby 1.9 and avoid deprecated
  rb_thread_select().

[...]

So you may be using an old pg gem. Upgrading this gem to at least 0.15.0 should fix your issue.

like image 186
cbliard Avatar answered Oct 06 '22 14:10

cbliard