# Getting Error

**URL:** <https://www.ruby-forum.com/t/getting-error/163113>\
**Category:** Rails\
**Created:** [March 17, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/getting-error/163113 "2009-03-17T12:59:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![divyamohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@divyamohan](https://www.ruby-forum.com/u/divyamohan)\
**Post date:** [March 17, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/getting-error/163113/1 "2009-03-17T12:59:42Z")

</div>

Hello,

I am a rails newbie. I am using ruby 1.8.6, rails 2.3.2 & chrome  
browser in windows XP.

I was trying out a hello world application. I ran the following  
commands.

* * *

## rails\> rails demo rails\> cd demo demo\> ruby script/server

And when I open [http://localhost:3000/](http://localhost:3000/) in my browser, I get a “Welcome  
aboard You’re riding Ruby on Rails!” message. This much is working  
fine.

## Then I did this.

## demo\> ruby script/generate controller Say

## And I edited app/controllers/say\_controller.rb as given.

## class SayController \< ApplicationController def hello end end

## Now when I open [http://localhost:3000/say/hello](http://localhost:3000/say/hello) in my browser, I get an error message

## We’re sorry, but something went wrong. We’ve been notified about this issue and we’ll take a look at it shortly.

## I created hello.rhtml in app/views/say/ as follows.
Hello, Rails!
# Hello from Rails!
----------------------------------------------------------------

Then, again I tried to open [http://localhost:3000/say/hello](http://localhost:3000/say/hello) in my  
browser, I still get the same error message. [The ‘demo\> ruby script/  
server’ command is still running.]

Can someone help me to figure out what went wrong.

---

<div class="post-metadata">

**Author:** ![divyamohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@divyamohan](https://www.ruby-forum.com/u/divyamohan)\
**Post date:** [March 18, 2009, 5:26am UTC](https://www.ruby-forum.com/t/getting-error/163113/2 "2009-03-18T05:26:59Z")

</div>

Did u properly setup database connections in config/database.yml ?

---

<div class="post-metadata">

**Author:** ![divyamohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@divyamohan](https://www.ruby-forum.com/u/divyamohan)\
**Post date:** [March 18, 2009, 5:54am UTC](https://www.ruby-forum.com/t/getting-error/163113/3 "2009-03-18T05:54:11Z")

</div>

Hi,  
As Sijo said, setup correct DB connection. You have to mention DB  
name in database.yml and also mentioned DB should be in your Mysql or  
whatever you are using.

Just mention DB name in database.yml and do as follows,

demo\> rake db:create:all

and then restart your server.

---

<div class="post-metadata">

**Author:** ![divyamohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@divyamohan](https://www.ruby-forum.com/u/divyamohan)\
**Post date:** [March 18, 2009, 9:25am UTC](https://www.ruby-forum.com/t/getting-error/163113/4 "2009-03-18T09:25:44Z")

</div>

Yes, I had not setup database connections earlier.

Now I fixed it and my Hello World is working fine. 🙂

Thanks to Sijo Kg & Priya B…
