Phusion passenger code being cached? - ruby-on-rails

I was adding some updates to my rails application, as well as upgrading from 3.0.4 to 3.1.1. I then ran into some errors. I was using the request.request_uri method, which threw an error. Once i corrected it locally, i pushed up my code. However even after restarting, the same error is being thrown. I can see my code is corrected on the server. Is there some sort of application caching i should check? Or anything else?

Looks like a stupid error on my part. Had an app folder sitting under app. So it was picking up the other helper file with the bad code, not the one i had updated. Happy i fixed it at least.

Related

EOFError (end of file reached)

I am not really sure what is going on with my rails app. I have not changed any code on my front page but I am getting the error EOFError (end of file reached) with no further information on the logs.
It is only the index page that has this issue. I would like to know, if there is any other way I can get more information on this error.
This is all I have from papertrail
Edit: In localhost everything works fine but once I have deployed to Heroku my frontpage does not work.
After a back and forth with Heroku, my issue ended up being resolved. There was no error in the code as this piece of code had been working all along. Heroku advised that maintenance occurs every night and maybe the moving of the app to a different dyno might have resolved the issue.
If anyone else ends up with a similar issue, if a restart does not fix it maybe ask Heroku to move you to a different dyno.

Rails annoying message We're sorry, but something went wrong

****We're sorry, but something went wrong.
If you are the application owner check the logs for more information.****
On various rails applications I have been getting this all the time. How can this be fixed for good on ruby on rails apps?
You will have to check the log and fix the error, for production application you can use services like airbreak or errbit a free solution. Whenever this page occurs you will receive full trace and error. Hope this will help you in making application much more stable.

how to debug web server on RoR?

I currently have a problem with a project.
it freezes before it shows the "Started GET ...." seems like it hits an infinite loop.
now i dont really have much experience with debuggers in ROR, can anyone recommend anything i can use to trace the exact origin of the problem. if i can get an error code somewhere then i might be able to fix it.
currently i am using webrick, i tried thin and it gave the exact same error.but i am willing to use anything to find the exact origin of this error.
it seems to be related to the project because all other projects works fine on my environment.
Take a look at the Rails guide on debugging.
Also try running the Rails console ("rails c"); if you can get to a command prompt at all that means that the issue is not in loading the Rails environment (e.g. a problem in application.rb) but is somewhere in the process of making a web request. If there's a failure it may give you a better error message.

Passenger "No such file to load" error for Model

I'm having a problem with deploying a Rails 3 app to a Passenger/Apache2/RVM server running Ubuntu 11.10.
I'm getting the error:
A source file that the application requires, is missing.
...
Error message: No such file to load -- Goal
Exception class: LoadError
Goal is one of my Rails Models.
I've seen a lot of people with a similar error message, but their issues seem to relate to missing bundles/gems - not model files! Their problems were resolved by ensuring permissions were set up correctly, so to that end I've got:
Apache running as www-data, as is Passenger. RVM is installed as www-data and I've chown'd the entire web app directory to www-data.
I've been wrestling with this for some time now and am really out of ideas - if anyone has any suggestions I'd be very grateful!
You might probably have the file structure of your Rails app wrong. Are you sure you have the "goal.rb" file within {your_app_root_url}/app/models/ ?
To me, if I am seeing the error when you view the app in browser, it seems like your rails app and passenger(with apache2) are working fine. The other possibility is you might be looking at wrong app folder which passenger is set up to.
It's hard to tell what's wrong. Please provide more details of how you set up your passenger with your rails app directory. Also it would help if you could show what's inside your app (app structure) and what's inside goal.rb model file.
Well I've solved it. Turned out that a work around for a problem with yaml encoded model archives (i.e. an explicit require of Goal) in a completely unrelated Model was causing the error to appear. Looks like it only rears its head in production - probably due to the differences between the class loaders used in development vs. production.
Tough one to find... the stack trace didn't include a reference to where the problem actually was!

How can I prevent cache/cookies from affecting the path of ckeditor javascript files in a production rails app?

I have a built a rails app in which I am using the ckeditor 3.5.1 together with the ckeditor gem.
When running in development, everything works fine. But when I run in production, I get errors.Sometimes, the text_area with the ckeditor does not show up. But when I clear my cache and cookies, everything works fine. Then after a while, the error comes up again. The error comes up more often than not.
Closer investigation reveals that when the error occurs, some files like staging.domain.com/javascripts/ckeditor/config.js are instead being requested from staging.domain.com/posts/config.js which is naturally non-existent
(posts is from my Post model)
How can the cache/cookies affect which path the files are served from?
Does anyone know what else might be wrong and how I can fix it?
P.S. I am using Phusion passenger in production.
It would seem the problem was being cased by mod_pagespeed which was activated. By disabling it, everything came back to normal.
I am curious though, about how this was happening.

Resources