# Doubts in running a sample web application

**URL:** <https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645>\
**Category:** Rails\
**Created:** [December 15, 2008, 8:18am UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645 "2008-12-15T08:18:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [December 15, 2008, 8:18am UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645/1 "2008-12-15T08:18:40Z")

</div>

Hai

Iam newbie.

Iam using ruby on rails, I have some doubts in it.

The steps i followed is  
Using ruby 1.8.6  
rails 2.2.2

[http://www.ibm.com/developerworks/linux/library/l-rubyrails/](http://www.ibm.com/developerworks/linux/library/l-rubyrails/)

1. created the rails project name

2)created the table name contacts in the addressbook database name in  
Mysql.

1. altered in the database.yml

adapter: mysql  
database: addressbook  
host: localhost  
username: root  
password: root  
pool: 5  
timeout: 5000

1. ruby script/generate model contact

5)ruby script/generate controller contact

6)ruby script/generate scaffold contacts.

1. altered in

class ContactController \< ApplicationController  
model :contact  
scaffold :contact  
end

Errors:

model is unknown.

1. 

class ContactsController \< ApplicationController  
def list  
@contacts = Contact.find\_all  
end  
def show  
@contact = Contact.find(@params[‘id’])  
end  
def create  
@contact = Contact.new(@params[‘contact’])  
if @contact.save  
flash[‘notice’] = ‘Contact was successfully created.’  
redirect\_to :action =\> ‘list’  
else  
render\_action ‘new’  
end  
end  
9) list.rhtml

\<% for contact in @contacts %\>

 \<% for column in Contact.content\_columns %\> \<%=h contact.send(column.name) %\> \<% end %\> \<%= link\_to 'Show', :action =\> 'show', :id =\> contact.id %\> \<%= link\_to 'Edit', :action =\> 'edit', :id =\> contact.id %\> \<%= link\_to 'Destroy', :action =\> 'destroy', :id =\> contact.id %\> \<% end %\>

Error: end

C:/Ruby/AddressBook/app/controllers/contacts\_controller.rb:16: syntax  
error, unexpected $end, expecting kEND

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [December 15, 2008, 10:46am UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645/2 "2008-12-15T10:46:19Z")

</div>

Hi  
Do like this  
rails project\_name  
./script/generate scaffold contact  
rake db:migrate  
Now run the application ./script/server

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [December 15, 2008, 10:41am UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645/3 "2008-12-15T10:41:07Z")

</div>

On Dec 15, 7:18 am, Angappan Ayyavoo \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> [IBM Developer](http://www.ibm.com/developerworks/linux/library/l-rubyrails/)

Your tutorial is 3 and a half years old. Rails has changed  
tremendously since then. A lot of that information in that tutorial  
doesn’t cover how newer versions of rails do it or just won’t work  
anymore.

> 1. altered in
> 
> class ContactController \< ApplicationController  
> model :contact  
> scaffold :contact  
> end
> 
> Errors:
> 
> model is unknown.  
> Both the model and scaffold methods were removed

> ```
> @contact = Contact.new(@params['contact'])
> 
> ```
> 
> C:/Ruby/AddressBook/app/controllers/contacts\_controller.rb:16: syntax  
> error, unexpected $end, expecting kEND

If you indent that file properly it should be clear that you are  
indeed missing an ‘end’

Fred

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [December 15, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645/4 "2008-12-15T14:33:16Z")

</div>

Thanks.  
For ur kind reply.

May I know which version of ruby and rails is stable.  
Give me some better links to learn and work in ruby on rails.

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [December 15, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/doubts-in-running-a-sample-web-application/155645/5 "2008-12-15T19:48:32Z")

</div>

Angappan Ayyavoo wrote:

> Thanks.  
> For ur kind reply.
> 
> May I know which version of ruby and rails is stable.  
> Give me some better links to learn and work in ruby on rails.

Ruby on Rails 2.2.2 is the current stable release of Rails.

[http://rubyonrails.org/screencasts](http://rubyonrails.org/screencasts)

> **[Ruby on Rails Guides](https://guides.rubyonrails.org/)**
>
> Ruby on Rails Guides

> **[Ruby on Rails Screencasts - RailsCasts](http://railscasts.com/)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

[http://www.therailsway.com/](http://www.therailsway.com/)  
[http://peepcode.com/](http://peepcode.com/)  
[http://www.railsenvy.com/](http://www.railsenvy.com/)  
[http://api.rubyonrails.org/](http://api.rubyonrails.org/)

Books:

> **[Pragmatic Bookshelf: By Developers, For Developers](https://pragprog.com)**
>
> We improve the lives of professional developers. We create timely, practical books on classic and cutting-edge topics to help you learn and practice your craft, and accelerate your career. Come learn with us.

[http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321445619](http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321445619)

That should get you started. Also from those links, look for other  
related links and get to know the community of Rails developers. Find  
and read their blogs. There is a ton of really good information out  
there, once you know where to start looking.
