Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails hiredis undefined symbol

I want to build a shopping cart for my website. I've installed redis/hiredis but when I start the server, if I go on a page where the shopping cart whould show a value (current items in cart), or if I want to go on the shopping cart page, the server crashes giving the following information:

   Started GET "/cart" for 127.0.0.1 at 2015-05-19 13:43:33 +0300
  ActiveRecord::SchemaMigration Load (0.1ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by CartsController#show as HTML
  User Load (0.2ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = ?  ORDER BY "users"."id" ASC LIMIT 1  [["id", 1]]
/home/svuser/.rvm/rubies/ruby-2.2.0/bin/ruby: symbol lookup error: /home/svuser/.rvm/gems/ruby-2.2.0/gems/hiredis-0.4.5/lib/hiredis/ext/hiredis_ext.so: undefined symbol: rb_thread_select

In my index page, I create a link to the shopping cart using the following instructions :

<%if signed_in?%>
    <li>
  <%= link_to cart_path do%>
    <i class="fi-shopping-cart"></i>
    My Cart
  <%end%>

Is there any way to work around this issue ? I am still new to rails and I couldn't figure it out on my own.

like image 281
Bogdan Molinger Avatar asked May 19 '15 10:05

Bogdan Molinger


1 Answers

I faced a similar problem. In my case, I use Ruby 2.2.2p95 and old version gem hiredis - '0.4.5'. It uses method rb_thread_select, which was removed in Ruby 2.2

So bundle update hiredis helps me.

like image 152
Alyosha Brovikov Avatar answered Oct 23 '22 13:10

Alyosha Brovikov