2010-11-27 99 views
0

在本地和生產環境中獲取此錯誤(無論乾淨安裝)。種子數據已被加載。 Rails 3.0.3,ruby 1.87(開發)和ruby 1.8.7 REE。Spree錯誤 - 註冊計算器時出錯計算器:: PriceBucket

熱潮寶石 禮包(0.3±0.1) spree_api(0.3±0.1) spree_auth(0.3±0.1) spree_core(0.3±0.1) spree_dash(0.3±0.1) spree_promo(0.3±0.1) spree_sample (0.3±0.1)

開發錯誤:

=> Booting WEBrick => Rails 3.0.3 application starting in development on http://0.0.0.0:3000 
=> Call with -d to detach => Ctrl-C to shutdown server 
Error registering calculator Calculator::PriceBucket 
[2010-11-27 12:57:49] INFO WEBrick 1.3.1 
[2010-11-27 12:57:49] INFO ruby 1.8.7 (2010-08-16) [i686-darwin10.4.3] 
[2010-11-27 12:57:49] INFO WEBrick::HTTPServer#start: pid=18146 port=3000 

PROD錯誤:

Error message: 
superclass mismatch for class PriceBucket 
Exception class: 
TypeError 
Application root: 
/home/deploy/webstores/mystore/current Backtrace: 

文件行位置

0 /home/deploy/.bundler/ruby/1.8/spree-e9c3485bf22e/core/app/models/calculator/price_bucket.rb 1 
+0

這不是我很舒服了解決方案,但它的工作原理,直到spree_core寶石更新 我分叉並「破解」了一個修復程序以使其正常工作 - github.com/dblsystems/spree 對此解決方案並不滿意,但它現在可行。 – BandsOnABudget 2010-11-27 23:12:47

回答

0

這結束了對我的工作雖然它從你的錯誤有很大不同:

還應當指出的是,事情的方式在Rails3中施普雷計算輕微位不同。該對象現在包含item_total的屬性,而不僅僅調用object.length

在我的主要擴展寶石:

def self.activate 
    Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| 
     Rails.env.production? ? require(c) : load(c) 
    end 
    Calculator::PerWeight.register 
    end 

在我的定義計算器:

def self.register 
    super 
    ShippingMethod.register_calculator(self) 
end