title: How can I clear the rails console history
body: <p>When I run <code>rails c</code> 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 <code>debugger</code> command for the ruby-debug gem. I would not only like to clear these commands out, but I would like it if <code>rails c</code> 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.</p>
  
  <h2>Update</h2>
  
  <p><a href="https://stackoverflow.com/users/688480/ray-baxter">Ray</a>'s <a href="https://stackoverflow.com/a/6517388/64669">answer</a> 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.</p>
  
  <p>IRB checks if you have a <code>~/.irbrc</code> and if not falls back to <code>/etc/irbrc</code> as Ray mentioned. However, if you are using <code>rvm</code> there is another file to consider <code>~/.rvm/scripts/irbrc</code> which just loads up <code>~/.rvm/scripts/irbrc.rb</code> (note the <code>.rb</code>) if you have <code>rvm_path</code> set in your <code>ENV</code> (you should if using <code>rvm</code>).</p>
  
  <p>Interestingly while <code>~/.rvm/scripts/irbrc.rb</code> was based off of <code>/etc/irbrc</code> 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 <code>/etc/irbrc</code> is being used your history file will be <code>~/.irb_history</code> where as <code>rvm</code>'s is <code>~/.irb-history</code> (<strong>Note</strong>: <code>_</code> vs <code>-</code>).</p>
  
  <p>Hopefully this additional information will help you determine what you need to setup your system as you would like.</p>
  
  <h1>Pry Concerns</h1>
  
  <p>I've since stopped using <code>debugger</code> and have moved to <code>pry-byebug</code> which includes the <code>pry</code> 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 <a href="https://stackoverflow.com/questions/34518803/why-does-pry-history-keep-cloberring-irb-history/38543091#38543091">my answer</a> to the SO question on <a href="https://stackoverflow.com/questions/34518803/why-does-pry-history-keep-cloberring-irb-history/38543091">"why does pry history keep cloberring irb history?"</a>. I've included links there to the known Github issue for Pry as well as my attempt to fix it.</p>