2013-11-24 61 views
3

此代碼用於使用rails 3.2.13和spree 2.0,現在使用rails 4.0和spree 2.1引發以下錯誤。Spree中的NameError ::產品#show

Showing /var/lib/gems/1.9.1/gems/spree_frontend-2.1.1/app/views/spree/products/show.html.erb where line #19 raised: 

undefined local variable or method `active_record' for #<ActiveRecord::Associations::JoinDependency::JoinAssociation:0xb3187c8> 

提取的源(圍繞線#19):

<% Spree::PROPERTIES_LEFT.each do |show_type| %> 
    <% unless @product_properties.hash_for(show_type).empty? %> 
    <% for title in @product_properties.hash_for(show_type).keys %> 

     <h6 class="product-section-title"><%= title %></h6> 

Rails.root:/home/anakin/SpreeTravelData/openjaf/spree_travel_demo

的線19是:

<% unless @product_properties.hash_for(show_type).empty? %> 

我該如何解決這個問題?

+1

什麼是@product_properties被設置爲?你使用的是什麼樣的鋼軌?它看起來像[在rails中有一個與此相關的提交](https://github.com/rails/rails/commit/d87966c1c4119dbfa0808d7bd477b59a6b5f232c)在4.0.0和4.0.1.rc4之間合併,所以我猜你'重新4.0.0 ...如果您升級到4.0.1,錯誤仍然發生? – carols10cents

回答

0

我想你應該嘗試清理環境,使乾淨捆綁安裝捆綁更新當你與軌道脫機工作,它得到棘手的保持上所有的依賴關係。我有這個確切的問題,這是要走的路。可悲的是上網或發瘋。