In the .NET world there is an awesome product called NHProfiler which provides insights into database activity via NHibernate. It can detect common problems (such as N+1 issues), and report on them from observing the queries that your application runs.
Is there a tool/app/gem that does the same kinda of things for Rails ActiveRecord?
Yes, there is one. check it this. https://github.com/flyerhzm/bullet