在看 敏捷开发的时候,在第八章的地方,存储 session 到 sqlite 的时候,出现问题 不能将选择的书,放到购物车里面。 出现的错误是: NoMethodError in StoreController#add_to_cart undefined method `<<'
def add_product (product)
@items << product
end
就是这里出的错误。不知道怎么搞的。
我的系统配置
Ruby version 1.9.3 (i686-linux)
RubyGems version 1.8.22
Rack version 1.4
Rails version 3.2.3
JavaScript Runtime therubyracer (V8)
Active Record version 3.2.3
Action Pack version 3.2.3
Active Resource version 3.2.3
Action Mailer version 3.2.3
Active Support version 3.2.3
Middleware
ActionDispatch::Static Rack::Lock #ActiveSupport::Cache::Strategy::LocalCache::Middleware:0xa3c5dd4 Rack::Runtime Rack::MethodOverride ActionDispatch::RequestId Rails::Rack::Logger ActionDispatch::ShowExceptions ActionDispatch::DebugExceptions ActionDispatch::RemoteIp ActionDispatch::Reloader ActionDispatch::Callbacks ActiveRecord::ConnectionAdapters::ConnectionManagement ActiveRecord::QueryCache ActionDispatch::Cookies ActiveRecord::SessionStore ActionDispatch::Flash ActionDispatch::ParamsParser ActionDispatch::Head Rack::ConditionalGet Rack::ETag ActionDispatch::BestStandardsSupport
Application root /root/ROR/depot Environment development Database adapter sqlite3 Database schema version 20120419051012