开发者

Rails controllers not working

开发者 https://www.devze.com 2022-12-28 10:18 出处:网络
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:

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"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号