Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:22:05+00:00 2026-05-26T17:22:05+00:00

Please can you share your approach / methodology to debugging in Ruby / Rails.

  • 0

Please can you share your approach / methodology to debugging in Ruby / Rails.

I’m busy with the Rails tutorial, and am getting the error:

NoMethodError in UsersController#show
undefined method `microposts' for #<User:0x83b43e8>

And that got me thinking about debugging strategies. Does anyone have advice for a new Rails user (and new MVC user) on strategies to approach debugging. What path do you follow? Is there a generally accepted approach? Is there a way to step through the code?

Right now I am using unit testing as a kind of “lint” checker, but that only goes so far.

Although I want to solve it, the actual error I am getting right now is not the main thrust of this question.

(PS: The problem is not a duplicated “show” as documented in elsewhere on Stackoverflow

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:22:05+00:00Added an answer on May 26, 2026 at 5:22 pm

    I haven’t seen this mentioned yet but another option is to put a debugger statement in your code. Like this

    def some_method
      something = 3
      debugger
      # ... more code
    end
    

    If this is in a rails app when the code reaches debugger it will cause the terminal window running the web server to jump into something that looks like an irb session (I’m not exactly sure what it is). From there you can do puts something to see what the value is for example. You can even puts params to see what all the params values are. You can also step through the code, jump to a specific line, etc.

    Pry seems to be a better way to go about this but it’s how I used to debug before I knew about pry.

    Note: You might need to do require 'ruby-debug' if you’re doing this outside of rails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please, share your favorite links on this language where one can learn the best
Can you please share your experience theming EXT 4 components with SASS and Compass
Can someone please share a extremely simple version of JQuery Ajax with pagination??
Please can anyone one point me to a good tutorial that helps me to
Can you share your most frequently applied (or favorite) software design patterns in .NET
i want to develop apps based on speech to text conversion.can you please share
Can you share your thoughts how would you implement data versioning in PostgreSQL. (I've
Please share your view on this kind of thing i'm currently testing out :
please share :how can connect titanium android application with Wcf Rest ???... sample code,or
Please share your favorite application design / design patterns for use in PHP with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.