views:

29

answers:

2

Hi Guys,

I've just started on rails, got it all setup on my DreamHost account with Passenger, except the demo controller I've created isn't working. I ran:

$ script/generate controller demo index

The files are all there, but when I go to http://rails.mysite.com/demo/index I get the 'We're sorry, but something went wrong' message. There's nothing in the log files at all, I'm in development mode.

Any help would be much appreciated, thanks!

Darren.

+1  A: 

You may not have initialized your database yet, in which case the Rails stack doesn't finish booting properly. If you can run script/console, then you're half-way there. If you can't, it may give you a hint as to what's wrong.

Generally the database.yml file contains a configuration for sqlite3, but that may not be available on your platform. It's pretty easy to switch that over to MySQL or Postgres, whatever you're using.

tadman
$ script/console Loading development environment (Rails 2.3.5) >> Looks good, the db is setup, it's MySQL but I've already configured that. It's just annoying that it's dying silently!
dazhall
It was a database issue after all. I started over and got an error message, turns out I was in production when my database was only configured for development. Thanks!
dazhall
+1  A: 

Did you map it in routes.rb?

Try something like:

map.connect "/demo/", :controller => "demo", :action => "index"
Veeti
I didn't think you had to map every controller that you make?
dazhall
There are default routes, usually, that pick these up, but it's always a good idea to map your own using map.resource
tadman