views:

83

answers:

2

I've been trying to get Rails working, but whenever I try to create my own view, it returns a 500 error.

So, here's the steps I've followed to get where I am:

I installed Ruby to C:\Ruby
I installed Rubygems to C:\Ruby\rubygems-1.3.5 and ran ruby setup.rb
In the cmd prompt, I installed rails using gem install rails.
I created a Projects folder in C:\Ruby, and navigated to it in the cmd prompt
In the cmd prompt, I ran rails project1, then cd project1
In the cmd prompt, I ran ruby script/generate controller home index
In the cmd prompt, I ran ruby script/server I haven't gotten any errors at all yet.

I go to http://localhost:3000, and everything is looking good.
I navigate to http://localhost:3000/home/index, and get this:

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

I have no clue why. Is there any troubleshooting I can do?

+1  A: 

Take a look at your development log at log\development, and look for a line that starts with

/!\ FAILSAFE /!\

The next lines below should tell you where to look for the error. If you cannot make out the issue, post the all lines from the log file that seem related.

elektroholunder
The FAILSAFE message is visible only when an exception is raised trying to handle an other exception. In the standard 500 message, no FAILSAFE flag is printed.
Simone Carletti
Thanks! I somehow assumed this was the case when you get a plain 500 in browser instead of a backtrace while in development environment.
elektroholunder
+2  A: 

When you create a project with rails projectname the config-file is set to use the Active Record framework for using a database with your application. If you don't want to use a database, simply open:
\config\enviroment.rb
And set the following line:
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
to:
config.frameworks -= [ :active_record]
Restart the server with CTRL+C, and then ruby script/server again. This should solve the problem.

As the other suggested, always have a look at \log\development.log to find the cause of such problems. I guess youre reads something like

Status: 500 Internal Server Error
no such file to load -- sqlite3

If you want to use a database with your application, see this guide: http://guides.rubyonrails.org/getting_started.html#configuring-a-database

Mads Mobæk
Thanks so much, that fixed it.
Andrew