Hello, I''m very new to Rails. I''ve been trying to set it up on my Linux server. The installation was smooth and painless. I followed the instructions on the Ruby on Rails website. So I''m running Rails 1.2.3, ruby 1.8.4 and Gem 0.9.0. I created a new application: rails testproject I''m trying to use Apache instead of having to use WebBrick because my server already uses Apache. So, it should be using dispatch.cgi via .htaccess. When I visit the page in my browser, I get the standard "Welcome aboard" message. But when I click "About your applications environment" I get "Application error Rails application failed to start properly". Digging into Apache''s error log, it is complaining about Premature end of script headers. So, I did some digging and found I should try running dispatch.cgi through the shell. When I do, I get this: [root@fire public]# ./dispatch.cgi Status: 400 Bad Request /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:404:in `to_constant_name'': Anonymous modules have no name to be referenced by (ArgumentError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:214:in `qualified_name_for'' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:476:in `const_missing'' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:117:in `reset_after_dispatch'' from /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:51:in `dispatch'' from ./dispatch.cgi:10 I''ve looked high and low and cannot find anything pointing to what the problem might be. I should note I did try running WebBrick, and through WebBrick everything works fine. So, it''s definitely an issue with dispatch.cgi I just don''t know what. Thanks in advance. JP -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Usually when I get the premature end of header error, I''ve been able to load up script/console and it will crash with a more robust error message letting me know that I''ve forgotten some code in config/environment.rb. If you''re not getting an error with Webrick, I''m not sure. But I''d start looking around in config/environment.rb. It seems that any problems in that file never make it to a non-Apache log whereas bugs in other files are written to the appropriate RAILS_ENV mode log file. Does that help? :/ RSL On 3/30/07, JP <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello, > > I''m very new to Rails. I''ve been trying to set it up on my Linux server. > The installation was smooth and painless. I followed the instructions on > the Ruby on Rails website. > > So I''m running Rails 1.2.3, ruby 1.8.4 and Gem 0.9.0. I created a new > application: > > rails testproject > > I''m trying to use Apache instead of having to use WebBrick because my > server already uses Apache. So, it should be using dispatch.cgi via > .htaccess. When I visit the page in my browser, I get the standard > "Welcome aboard" message. But when I click "About your application''s > environment" I get "Application error > Rails application failed to start properly". Digging into Apache''s error > log, it is complaining about Premature end of script headers. So, I did > some digging and found I should try running dispatch.cgi through the > shell. When I do, I get this: > > [root@fire public]# ./dispatch.cgi > Status: 400 Bad Request > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2 > /lib/active_support/dependencies.rb:404:in > `to_constant_name'': Anonymous modules have no name to be referenced by > (ArgumentError) > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2 > /lib/active_support/dependencies.rb:214:in > `qualified_name_for'' > from > /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2 > /lib/active_support/dependencies.rb:476:in > `const_missing'' > from > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:117:in > `reset_after_dispatch'' > from > /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:51:in > `dispatch'' > from ./dispatch.cgi:10 > > I''ve looked high and low and cannot find anything pointing to what the > problem might be. I should note I did try running WebBrick, and through > WebBrick everything works fine. So, it''s definitely an issue with > dispatch.cgi I just don''t know what. > > Thanks in advance. > > JP > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Russell. So I did a bit more digging and have found that most people with this issue just abandon SCGI and head for FCGI and things just magically work. Lo and behold I compiled mod_fastcgi as a DSO for Apache, installed ruby-fcgi, fixed .htaccess and hallelujah, different error! After digging into the development log, it was clear it was a permission error on tmp and after fixing that I get "For security purposes, this information is only available to local requests." YEY, it works! I''m thinking I don''t even know why they bother to include SCGI since it doesn''t work for 9.5/10 people. Thanks for your quick reply. JP Russell Norris wrote:> Usually when I get the premature end of header error, I''ve been able to > load > up script/console and it will crash with a more robust error message > letting > me know that I''ve forgotten some code in config/environment.rb. If > you''re > not getting an error with Webrick, I''m not sure. But I''d start looking > around in config/environment.rb. It seems that any problems in that file > never make it to a non-Apache log whereas bugs in other files are > written to > the appropriate RAILS_ENV mode log file. Does that help? :/ > > RSL-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Heh. Man, I apologize for having misread your email. I thought you were talking about dispatch.fcgi [with an "f"]. [Stupid slow-acting coffee!] Glad you got things working though. RSL On 3/30/07, JP <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Thanks Russell. > > So I did a bit more digging and have found that most people with this > issue just abandon SCGI and head for FCGI and things just magically > work. Lo and behold I compiled mod_fastcgi as a DSO for Apache, > installed ruby-fcgi, fixed .htaccess and hallelujah, different error! > After digging into the development log, it was clear it was a permission > error on tmp and after fixing that I get "For security purposes, this > information is only available to local requests." > > YEY, it works! > > I''m thinking I don''t even know why they bother to include SCGI since it > doesn''t work for 9.5/10 people. > > Thanks for your quick reply. > > JP > > Russell Norris wrote: > > Usually when I get the premature end of header error, I''ve been able to > > load > > up script/console and it will crash with a more robust error message > > letting > > me know that I''ve forgotten some code in config/environment.rb. If > > you''re > > not getting an error with Webrick, I''m not sure. But I''d start looking > > around in config/environment.rb. It seems that any problems in that file > > never make it to a non-Apache log whereas bugs in other files are > > written to > > the appropriate RAILS_ENV mode log file. Does that help? :/ > > > > RSL > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---