small medium large xlarge

Generic-user-small
03 Jan 2009, 19:03
Lyman Neuschaefer (1 post)

I’ve encountered a problem in working through the depot example starting in Chapter 8 (Task C: Cart Creation): when clicking on the ‘Add to Cart’ button on the store page a ‘500 Internal Server Error’ is encountered.

On pressing the ‘Add to Cart’ button the log/development.log records:

Processing StoreController#add_to_cart (for 127.0.0.1 at 2009-01-03 10:36:41) [POST]
  Session ID: 274b586a21631c8fad09a815313dfef5
  Parameters: {"authenticity_token"=>"64e43589cdb1bcdc96961512f073eeaecbf9f427", "id"=>"1"}
  Product Load (1.0ms)   SELECT * FROM "products" WHERE ("products"."id" = 1)
Rendering template within layouts/store
Rendering store/add_to_cart
Completed in 37ms (View: 9, DB: 2) | 200 OK [http://localhost/store/add_to_cart/1]

Processing StoreController#add_to_cart (for 127.0.0.1 at 2009-01-03 10:36:41) [POST]
  Session ID: 274b586a21631c8fad09a815313dfef5
  Parameters: {"authenticity_token"=>"64e43589cdb1bcdc96961512f073eeaecbf9f427", "id"=>"1"}

ActiveRecord::StatementInvalid (SQLite3::SQLException: unable to open database file: UPDATE "session
s" SET "updated_at" = '2009-01-03 18:36:41', "data" = 'BAh7BzoJY2FydG86CUNhcnQGOgtAaXRlbXNbBm86DFByb...

where the random character sequence assigned to ‘data’ is 1164 characters long. I am running:

  * Windows Vista Home Premium, SP 1, 64-bit
  * Cygwin
  * Rails 2.2.2
  * Ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

Prior to and following pressing ‘Add to Cart’ the sqlite3 db contains a single entry in the sessions table (w/data=an 82-char long string), which was inserted by rails when I accessed the address localhost:3000/store. Thus, rails is able to read the sqlite3 db as well as insert into the sessions table.

You must be logged in to comment