Forum: Ruby on Rails Getting Error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6504a1825b8a4ab1485d82aa45d697d1?d=identicon&s=25 Divya Mohan (divyamohan)
on 2009-03-17 12:59
(Received via mailing list)

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

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

And when I open http://localhost:3000/ in my browser, I get a "Welcome
aboard You’re riding Ruby on Rails!" message. This much is working

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

Now when I open 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

I created hello.rhtml in app/views/say/ as follows.
<title>Hello, Rails!</title>
<h1>Hello from Rails!</h1>

Then, again I tried to open 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.
661ae6e97d0e16c2af2aaf7d197e8387?d=identicon&s=25 Sijo k g (sijo)
on 2009-03-18 05:26
Did u properly setup database connections in config/database.yml ?
0348be81e22f24afdaa6e4f137aa9dfc?d=identicon&s=25 Priya Buvan (priyadharsini)
on 2009-03-18 05:54
   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.
6504a1825b8a4ab1485d82aa45d697d1?d=identicon&s=25 Divya Mohan (divyamohan)
on 2009-03-18 09:25
(Received via mailing list)
Yes, I had not setup database connections earlier.

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

Thanks to Sijo Kg & Priya Buvan.
This topic is locked and can not be replied to.