# NEWBIE - Agile Web development Book - posting #3

**URL:** <https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658>\
**Category:** Rails\
**Created:** [October 26, 2006, 12:42am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658 "2006-10-26T00:42:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![analyst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@analyst](https://www.ruby-forum.com/u/analyst)\
**Post date:** [October 26, 2006, 12:42am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658/1 "2006-10-26T00:42:55Z")

</div>

1). regarding the book book “agile web development with rails 2nd  
edition” , I am now on chapter 8, Task C+: Cart Creation, and I have  
encountered a new bug in following the material.

as the book instructs, in order to resolve an migration issue to  
display my depot application, I need to clear the session.So as  
instructed , i issue the command ;

C:\rails\depot\>rake db:sessions:clear

2). what i get is :

(in C:/rails/depot)  
rake aborted!  
Mysql::Error: #42S02Table ‘depot\_development.sessions’ doesn’t exist:  
DELETE FRO  
M sessions

(See full trace by running task with --trace)

C:\rails\depot\>

3). i researched previous postings on this, and found something  
interesting from a “Peter Vandenberk” who writes:

From: joe - view profile  
Date: Wed, Sep 13 2006 11:10 pm  
Email: joe [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Not yet rated  
Rating:  
show options  
Reply | Reply to Author | Forward | Print | Individual Message | Show  
original | Report Abuse | Find messages by this author

Peter Vandenberk wrote:

> > That syntax is now deprecated in favor of adding the following  
> > declaration in your model file:

> > include Reloadable

> See also: [http://clarkware.com/cgi/blosxom/2006/03/28](http://clarkware.com/cgi/blosxom/2006/03/28)

> Let us know how it goes! 🙂

> Peter

3). THIS SOUNDS LIKE A SOLUTION , BUT I AM NOT SURE WHERE TO POST THIS  
COMMAND IN THE MODELS. AND I CANT REPLY TO HIS POSTIGN BECAUSE ITS 30  
DAYS OLD, AND GOOGLE WONT ALLOW IT.

4). WHAT CAN I DO ? WHY ISNT THE RAKE COMMAND WORKING? WHERE DO I  
ISSUE TEH CODE SNIPPET - "INCLUDE RELOADABLE " TO GET IT TO WORK.

---

<div class="post-metadata">

**Author:** ![analyst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@analyst](https://www.ruby-forum.com/u/analyst)\
**Post date:** [October 26, 2006, 1:04am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658/2 "2006-10-26T01:04:56Z")

</div>

> (in C:/rails/depot)  
> rake aborted!  
> Mysql::Error: #42S02Table ‘depot\_development.sessions’ doesn’t exist:  
> DELETE FRO  
> M sessions

I don’t have my copy of the AWDWR book on this computer, but if memory  
serves, you need to do:

```
rake db:sessions:create
rake db:migrate

```

Before the sessions table will exist, and thus, before you can clear it.

– Tammy

---

<div class="post-metadata">

**Author:** ![analyst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@analyst](https://www.ruby-forum.com/u/analyst)\
**Post date:** [October 26, 2006, 1:47am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658/3 "2006-10-26T01:47:00Z")

</div>

1). book doesnt inmention your suggestion , but i tried it anyway.  
Here is what i get :

C:\rails\depot\>rake db:sessions:clear  
(in C:/rails/depot)  
rake aborted!  
Mysql::Error: #42S02Table ‘depot\_development.sessions’ doesn’t exist:  
DELETE FRO  
M sessions

(See full trace by running task with --trace)

C:\rails\depot\>rake db:sessions:create  
(in C:/rails/depot)  
exists db/migrate  
create db/migrate/004\_add\_sessions.rb

C:\rails\depot\>rake db:sessions:migrate  
(in C:/rails/depot)  
rake aborted!  
Don’t know how to build task ‘db:sessions:migrate’

(See full trace by running task with --trace)

C:\rails\depot\>rake db:sessions:clear  
(in C:/rails/depot)  
rake aborted!  
Mysql::Error: #42S02Table ‘depot\_development.sessions’ doesn’t exist:  
DELETE FRO  
M sessions

(See full trace by running task with --trace)

C:\rails\depot\>

2). PLEASE HELP , PROBLEM NOT RESOLVED YET. WHY DOE IT SAY ‘DEPOT  
DEVELOPMENT.SESSIONS DOESNT EXIST’, HOW CAN I RESOLVE?

---

<div class="post-metadata">

**Author:** ![analyst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@analyst](https://www.ruby-forum.com/u/analyst)\
**Post date:** [October 26, 2006, 2:55am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658/4 "2006-10-26T02:55:03Z")

</div>

1. THAT WORKED  
BUT WHEN I DP I REFRESH ON MY ADD\_TO\_CART/2 website, I now i get :

NoMethodError in Store#add\_to\_cart  
Showing app/views/store/add\_to\_cart.rhtml where line #10 raised:

undefined method `quantity’ for #Product:0x3916e98

Extracted source (around line #10):

7:  
8:

  
9: \<% for cart\_item in @cart.items %\>  
10: - \<%= cart\_item.quantity %\> × \<%= h(cart\_item.title)  
%\>
  
11: \<% end %\>  
12: 

RAILS\_ROOT: ./script/…/config/…

3). NOT SURE HOW TO HANDLE THIS ONE …

…

---

<div class="post-metadata">

**Author:** ![analyst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@analyst](https://www.ruby-forum.com/u/analyst)\
**Post date:** [October 26, 2006, 1:57am UTC](https://www.ruby-forum.com/t/newbie-agile-web-development-book-posting-3/73658/5 "2006-10-26T01:57:01Z")

</div>

1). PLEASE DISREGARD MY LAST REPONSE. TAMMY’S SUGGESTION MADE ME  
REALIZE THAT I MISSED THE BEGININNG OF THE SECTION OF TASK C , AND SO  
DIDNT FOLLOW SOME OF THE BEGINNING WORK .

I SHOULD HAVE NO MORE PROBLEMS WITH ‘SESSIONS’ ONCE I REVIEW THE  
ENTIRE SECTION .

STAY TUNED , AND THANKS …
