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

  • SEARCH
  • Home
  • 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 6088057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:56:29+00:00 2026-05-23T11:56:29+00:00

When I run rails c and press the up key when irb starts up,

  • 0

When I run rails c and press the up key when irb starts up, I can see the last commands I entered when my app dropped to irb after encountering a debugger command for the ruby-debug gem. I would not only like to clear these commands out, but I would like it if rails c would pull the last commands I issued during my last rails console session. I think it used to do this but I’m not sure what has changed. I’m on ruby 1.8.7 and rails 3.0.3 on Mac OS 10.6.5 if that helps.

Update

Ray‘s answer helped me out in the interim. Recently I did a bit more digging to find out more and realized that there are a number of conflicting issues.

IRB checks if you have a ~/.irbrc and if not falls back to /etc/irbrc as Ray mentioned. However, if you are using rvm there is another file to consider ~/.rvm/scripts/irbrc which just loads up ~/.rvm/scripts/irbrc.rb (note the .rb) if you have rvm_path set in your ENV (you should if using rvm).

Interestingly while ~/.rvm/scripts/irbrc.rb was based off of /etc/irbrc they are not the same and differ in a few ways. The most obvious way and easiest way to detect which one is being used on your system is their history file’s name. If /etc/irbrc is being used your history file will be ~/.irb_history where as rvm‘s is ~/.irb-history (Note: _ vs -).

Hopefully this additional information will help you determine what you need to setup your system as you would like.

Pry Concerns

I’ve since stopped using debugger and have moved to pry-byebug which includes the pry gem. Pry is an alternative to IRB but can also be used along side and within it. The reason I was able to provide the above update is because I was trying to figure out how to keep their respective histories separate. For more information please see my answer to the SO question on “why does pry history keep cloberring irb history?”. I’ve included links there to the known Github issue for Pry as well as my attempt to fix it.

  • 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-23T11:56:29+00:00Added an answer on May 23, 2026 at 11:56 am

    I interpret you question as asking how to turn history on in the Rails Console and off in the Ruby debugger. If this isn’t true, please clarify.

    IRB, and by extension, the Rails Console, read from ~/.irbrc, or if that doesn’t exist, /etc/irbrc, to startup and configure irb. Your history is typically written to ~/.irb_history, but that is dictated by the contents of your irbrc file. The /etc/irbrc on my Mac OS X is set up to write the history from irb, so perhaps you’ve created a local .irbrc that doesn’t have history, or perhaps you have a syntax error in that file.

    The debugger reads a file called .rdebugrc on startup. You can turn off history in debug by adding this line to ~/.rdebugrc:

    set history save off
    

    Turn it back on with:

    set history save on
    

    You could also set your debug output to go to a different file than irb reads from with the command:

    set history filename
    

    These also work from the debug prompt, but aren’t persistent.

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

Sidebar

Related Questions

After our Ruby on Rails application has run for a while, it starts throwing
I'm using webrick to run my rails app in development mode. The page includes
I am trying to run jquery through a rails app. I have the edit
Given that both Ruby on Rails (RoR) and Grails can run on the JVM
I'm looking to run Redmine, a Ruby on Rails app, on a VPS windows
When I run rails new app...I get this error /Library/Ruby/Site/1.8/rubygems/specification.rb:542:in `read': Permission denied -
I'm installing a new server for run Rails apps, I already have 1 app
There's one thing that I can't figure out. When I try to run rails
I'm trying to use PDFKit as middleware in a rails 3 app. I can
I'm trying to run a rails 3 app on a windows server using jruby

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.