Rails already initialized constant HELP_MAPPINGS - ruby-on-rails

I am working through the Ruby on Rails Tutorial Sample app and I don't understand how I can fix the warning and the multiple tests that get run every time but don't do anything.
Screenshot of multiple tests running with the warning.
I am unsure if this is messing with performance or if it something I should just ignore, but I would like to resolve this issue if possible.
Thanks for the help, friends!

Related

How to find out why rails server hangs at 100%?

Can someone think of a way to find out where our rails production server hangs? Its CPU is at 99% so I assume it gets lost in a while/for/each loop. Unfortunately we can't find a candidate loop.
The problem does not occur in development and our test suit now has 100% code coverage.
We were already attaching to Ruby via gdb, but didn't know where to go from there.
Any ideas?
Once you have attached with gdb to the busy looping process then call rb_backtrace from gdb:
> call rb_backtrace()
The output from rb_backtrace will be similar to a crash report, and the output will go to your log files similar to a standard Ruby error backtrace.
From there you should hopefully already be a step closer to the solution since you will see where in your Ruby code the process is stuck.
You can check out some more tips here:
http://isotope11.com/blog/getting-a-ruby-backtrace-from-gnu-debugger
This is not a clean solution but at least the following resolved the problem for us: we migrated to the 'thin' webserver and removed 'devise'.

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.

ruby on rails unable to find interface that appears to be proplery defined

I'm brand new to ruby on rails and trying to run an application developed by others. I downloaded it from SVN it running yesterday, but today when I try to run it the first attempt to access the site's home page I get the message:
expected .../app/helpers/interface/table_helper.rb to define Interface::tableHelper.
.../lib/active_support/dependencies.rb:452:in 'load_missing_constant'
This file exists, and properly defines the tableHelper interface. Since I was able to run the program when I was setting it up yesterday, and others can run it without issue, I assume the problem I'm seeing is caused by an incorrectly set up environment rather then bad code somehow.
Can anyone suggest what I might try to figure out why rails can't seem to detect a properly defined interface?
If you were able to run the program once, perhaps something got screwed up? Have you made any changes to the code?
Alternatively, try stopping and restarting the server.
Also: what's the application? Maybe we can look at the codebase...

ActiveRecord association not found - but only on second load

I recently upgraded from Rails 2.0.2 to 2.3.8 and have been ironing out the kinks. This one is baffling me.
I have a page that runs fine in production, but in development mode it runs fine on first load, then on reload it crashes with:
ActiveRecord::ConfigurationError - Association named 'average_prices' was not found; perhaps you misspelled it?
It's a nested eager-load call:
list_user.bookmarks.visible_to_user(logged_in_user_id).find(:all, :conditions=>filter, :include=>[:user, {:gift=>:average_prices}, :tags, :product_image])
My feeling is that the error isn't strictly related to the real problem... aside from the fact that the code runs correctly (in production) I have also observed other errors sporadically in my app to the effect of:
A copy of [one of my helper classes] has been removed from the module tree but is still active!
Googling for this has resulted in much discussion of marking classes as "unloaded" and using "require_dependency" instead of "require"... but I've tried a number of things without any luck.
Does anyone have any clues here? Something seems funky to me with regard to loading/reloading classes.
NOTE: I think what I'm seeing is likely the same as this, but the fix posted here didn't work for me.
I've had similar problems when I was using certain plugins. Could this come from a plugin?

Ruby on Rails fails to connect to Mongodb locally using MongoMapper

I'm very new to rails and have been trying to experiment with using Mongodb on a web app.
I have been following this railscast tutorial here word for word and have been running into issues with it not connecting to my local Mongodb.
I'm sure Mongodb is up and running since mongod shows up in my activity monitor and going to
http://localhost:28017/
shows:
http://imgur.com/KJ0JI.png
The problem is when I go to 0.0.0.0:3000/projects/new and try to add a new project name,
this comes up:
http://imgur.com/yxRwC.png
Here is my output when running script/server:
http://imgur.com/A9JTE.png
On my other apps, I have been using sqlite and haven't been having any issues.
I tried uninstalling mongodb and running it anyways for testing purposes and I get
the exact some issue. I guess Mongodb simply isn't being detected through rails and MongoMapper.
Anyone have any idea how to fix this thing?
I spent many hours trying to fix this and resorted to getting a stackoverflow account
and asking on here.
Let me know if there's anything else anyone needs to possibly help diagnose the problem.
Any help would be appreciated.
note: sorry, since I'm new, I can't post pictures of the errors.
I hope you can take the time to view them on imgur

Resources