Rails Failsafe 500 Error
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About rails 500 error json Us Learn more about Stack Overflow the company Business Learn more about hiring developers rails 500 error no log or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Rails returns a 500-error (Not sure why) up vote 1 down vote favorite 1 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? ruby-on-rails ruby share|improve this question asked Dec 5 '09 at 17:23 Andrew 3,688113448 1 There should be more details of the error either in the command prompt window used to run ruby script/server or in project1\log\development.log. –Phil Ross Dec 5 '09 at 17:40 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted 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 followin
2.3 (including 2.2.2), and serving it with mongrel, you are at risk of serving up incorrect internal server pages. Patch one file in rails in an uncontrovercial way and be happy again. Skip to the end to see the patch. The long and boring details I had a problem with some infrastructure that was causing exceptions to (occasionally) be raised accessing the session store. When this happened, it would result in rails dumping a message in the production.log with a distinctive keyword: "/!\ FAILSAFE /!\". Rails would then try to return a 500 status http://stackoverflow.com/questions/1852796/rails-returns-a-500-error-not-sure-why to the client, but in fact would return a 200 status with malformatted content: Status: 500 Internal Server Error Content-Type: text/html
500 Internal Server Error
Those two lines at the top that look like headers aren't … they're the beginning of the body of the response. See the actual headers with ‘curl -o /dev/null -verbose': > GET / HTTP/1.1 > User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 https://billkirtley.wordpress.com/2009/03/03/failsafe-handling-with-rails/ OpenSSL/0.9.7l zlib/1.2.3 > Host: localhost:3000 > Accept: */* > < HTTP/1.1 200 OK < Connection: close < Date: Tue, 03 Mar 2009 19:03:49 GMT < Content-Type: text/html < Content-Length: 122 Infrastructure upstream treated that response as cacheable, so the intermittent error got amplified by the lack of cache error. Lots of clients wound up successfully fetching a document that said "500 Internal Server Error". We don't like that. We fixed the problem that caused the original "/!\ FAILSAFE /!\", but a little digging revealed that any failsafe produced by rails served by mongrel for any reason would have this problem. More digging revealed that the problem has to do with the way mongrel and rails interact. In fact it has to do with the fact that mongrel subverts the CGI interface it flanges to rails with, and does so in a way that's incompatible with the one rails code path that produces that FAILSAFE. Rails tries to do the right thing, but fails because of mongrel's cleverness. All of this has been tested with Rails 2.0, 2.1, and 2.2.3 with mongrel 1.1.4. Rails 2.3 doesn't have this problem. Mongrel is the application serveRuby, Gem, Rails, and then Redmine on my Redhat Linux Enterprise server. I'm struggling to get redmine to run correctly. I posted in another thread and 500 error received advice recommending the installation of mongrel, which I tried. If I clear cookies in my browser and load the page, the initial page displays perfectly. Clicking on any page returns the rails 500 error 500 error. if I clear my cookies, I can view the inital page again, but the pattern repeats: I can view any page and then clicking a link returns another 500 error. Thanks in advance for any help. Here's what Mongrel shows in response to the request: /!\ FAILSAFE /!\ Wed Jun 18 14:17:21 +0000 2008 Status: 500 Internal Server Error wrong number of arguments (2 for 1) /usr/lib/ruby/1.8/cgi/session.rb:267:in `respond_to?' /usr/lib/ruby/1.8/cgi/session.rb:267:in `initialize_without_cgi_reader' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_ext/session.rb:39:in `initialize' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:130:in `new' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:130:in `session' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:166:in `stale_session_check!' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/cgi_process.rb:114:in `session' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1131:in `assign_shortcuts_without_flash' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/flash.rb:167:in `assign_shortcuts' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:518:in `process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:17
internal server error on every issue creation/update. When creating/updating issue, this is from the log: Processing IssuesController#new (for 89.216.115.50 at 2010-04-21 10:05:24) [POST] Parameters: {"commit"=>"Create", "project_id"=>"epermit", "action"=>"new", "authenticity_token"=>"4FAiBNDmMajWE9w40LQIqdEAMtCmh+lwDoWEp7+JUTc=", "issue"=>{"start_date"=>"2010-04-21", "estimated_hours"=>"", "priority_id"=>"4", "done_ratio"=>"0", "assigned_to_id"=>"3", "subject"=>"Test issue", "tracker_id"=>"1", "due_date"=>"", "status_id"=>"1", "description"=>"Testing it."}, "controller"=>"issues", "attachments"=>{"1"=>{"description"=>""}}} Redirected to http://dev.etondigital.com:3000/issues/7 Completed in 113ms (DB: 24) | 302 Found [http://XXX/projects/epermit/issues/new] And it displays Internal error. When I click on back, the issue is created regardless of the error. While updating issue, the same happens, only I get this after clicking Back on the error page: /!\ FAILSAFE /!\ Wed Apr 21 10:06:57 +0200 2010 Status: 500 Internal Server Error undefined method `merge' for nil:NilClass /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/request.rb:385:in `parameters' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/base.rb:1288:in `assign_shortcuts' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/base.rb:527:in `process_without_filters' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/rescue.rb:65:in `call_with_exception' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:90:in `dispatch' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call' /opt/redmine-0.9.3/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack' /opt/redmine-0.9.3/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call' /opt/redmine-0.9.3/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `call' /opt/redmine-0.9.3/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /opt/redmine-0.9.3/vendor/rails/activerecord/lib/active_reco