Welcome Guest | Login

We're sorry, but something went wrong.

Hi,

This is my first application. I went throught the tutorial for deploying with fastcgi but I couldn't make my app working. I receive 500 internal server error. Could you please explain me what this error means and how can i fix it?


inside 'production.log',


Processing Base#index (for 88.235.144.53 at 2008-01-22 03:56:32) [GET]
 Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--e6f2926af096f31ab5f972f1da74317af748dd55
 Parameters: {"action"=>"index", "controller"=>"folders"}


LoadError (Expected /home/ozankiy/ozankiymac/app/controllers/folders_controller.rb to define FoldersController):
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:249:in `load_missing_constant'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/inflector.rb:257:in `constantize'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/string/inflections.rb:148:in `constantize'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1426:in `recognize'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in `with_signal_handler'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!'
   dispatch.fcgi:24

Rendering /home/ozankiy/ozankiymac/public/500.html (500 Internal Server Error)


**

Thanks!

2008-01-21 03:41 PM

Hi,

The tutorial below is dedicated to those who are worried receiving 500 error on their app,
http://www.hostingrails.com/forums/wiki_thread/9

Please give it careful read and let us know if you have questions.

2008-01-21 04:36 PM

Yes I have read thread/9 carefully before posting it. I believe It's not shebang problem because I have created my application on remote server as suggested. Also my RAILS_GEM_VERSION is correct in environment.rb. both local and remote rails version is 2.0.2. Permissions seemed ok too. Last thing is gem issue. But I don't use any custom gems. All my plug-ins are all uploaded and stay in 'vendor' folder.

2008-01-21 05:15 PM

There seem to a coding error. Please have a look at what I could see in production log.

LoadError (Expected /home/username/ozankiymac/app/controllers/folders_controller.rb to define FoldersController):

Please take a closer look at your code and get this fixed.

2008-01-21 06:13 PM

Hi Varun, thanks for your help. But it seems to me it is not a coding error (I mean everything is 'code' so It should be :-)) Because every request to 'domain.com/controller_name' gives the same error, expected x to define y. Whatever the controller_name is... Any other suggestions?

2008-01-22 04:15 AM

I had the same problem with one of my controllers a while back.  Try the following to see if it works:

1. Log in via SSH to your server and go your app directory.
2. Open the console and call the erroneous controller/model:
$ script/console -e production
Loading production environment
>> FoldersController
>> Folder
Of course, you'll want to call the model or controller that is giving you the error message, as appropriate.

If you don't see any errors after that, then that's good news!  Go ahead and exit the console and stop, then start the mongrel server.  (It seems to work better in this instance to stop, then start, instead of using the mongrel_rails restart command).

Go check out your log and reload the page.

Hope that helps,
-Justus

2008-01-22 06:27 PM

MarketPointe Realty Advisors
Im having the same  "expected x to define y" problem. Ive poured over all the forums, and tried everything suggested, but still Im stuck with the error page and the "expected x to define y" in my error logs.

The error I get is as follows:

Processing Base#index (for 66.118.196.207 at 2008-02-17 18:48:47) [GET]
 Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D--cdfd7f9c27812ce38b2130fa449aa32493919db9
 Parameters: {"action"=>"index", "controller"=>"site"}


LoadError (Expected /home/jeremyc/test_app/app/controllers/site_controller.rb to define SiteController):
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:249:in `load_missing_constant'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:in `const_missing'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/inflector.rb:257:in `constantize'
   /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/core_ext/string/inflections.rb:148:in `constantize'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1426:in `recognize'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in `handle_request'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:101:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:149:in `with_signal_handler'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:99:in `process_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:77:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'
   /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:76:in `process_each_request'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:50:in `process!'
   /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/fcgi_handler.rb:24:in `process!'
   dispatch.fcgi:24

Rendering /home/jeremyc/test_app/public/500.html (500 Internal Server Error)

Im at my wits end, and since Im new at deploying Rails apps, Ive no clue where to turn to resolve this issue. Any help is greatly appreciated.

-Jeremy

2008-02-17 06:56 PM

Jeremy - Does this app work locally on your development machine ?
What version of Rails are using on it ? - You may try freezing to the same version on your account too.

The command below is for freezing Rails to 1.2.5
rake rails:freeze:edge TAG=rel_1-2-5

2008-02-17 07:10 PM

It does work locally, and you're right, it is running under 1.2.5. I went in and froze the version, following the tutorial on this, and now, when I visit my site, I just get the "Rails application failed to start properly" error.

I did a bit of looking around, and found that my .htaccess file was missing. I reuploaded through ftp, and it disappeared again. I am officially perplexed. It doesnt show up in the ftp file browser, nor the built in browsers in Cpanel. Im pretty sure this is the reason why my app isnt starting, but I have no clue what to do about it.

Is there some stupid mistake Im making when Im uploading the file? Is there something you have to set somewhere? Or is it just randomly disappearing for no reason?

2008-02-17 09:55 PM

I've commented out the following entry in your environment.rb file.
---------
config.action_controller.session = {
   :session_key => '_test_app_session',
   :secret      => '21af1d10ed0bfa24b8070b16e28c8ecd2b5f0c1488068098afb389e50ce1d1acba09c7ce723ddc2494943234bfbd812e2d66066657bff974611e1ffb088f3eae'
 }

Now your site is working fine. Also I could see the .htaccess file under public directory. Please check.

2008-02-17 11:16 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.