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.
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.
Did you map it in routes.rb
?
Try something like:
map.connect "/demo/", :controller => "demo", :action => "index"
精彩评论