2015-05-19 47 views
5

我想爲我的網站構建一個購物車。我安裝了redis/hiredis,但是當我啓動服務器時,如果我在購物車顯示值(購物車中的當前項目)的頁面上,或者如果我想要購物車頁面,服務器崩潰給出以下信息:rails hiredis undefined symbol

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 

在我的索引頁,我創建了一個鏈接,使用下面的說明購物車:

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

有什麼辦法來解決這個問題?我還是個新手,我無法自己想出來。

回答

6

我遇到過類似的問題。在我的情況下,我使用Ruby 2.2.2p95和舊版本gem hiredis - '0.4.5'。它使用Ruby 2.2中刪除的方法rb_thread_select。

所以bundle update hiredis幫助我。

相關問題