.irb-history

Hello! Please, tell me, does anyone know how to increase the history
file above 100 lines to be saved in 1.9.2.

Hello! Please, tell me, does anyone know how to increase the history
file above 100 lines to be saved in 1.9.2.

IRB.conf[:SAVE_HISTORY] = 1000

On Dec 31, 7:25am, Anurag P. [email protected] wrote:

Hello! Please, tell me, does anyone know how to increase the history
file above 100 lines to be saved in 1.9.2.

IRB.conf[:SAVE_HISTORY] = 1000


Anurag P.

$ wc -l ~/.irb-history
100 /home/dima/.irb-history
$ r c
Loading development environment (Rails 3.0.1)
ruby-1.9.2-p0 > IRB.conf[:SAVE_HISTORY] = 1000
=> 1000
ruby-1.9.2-p0 > ‘one’
=> “one”
ruby-1.9.2-p0 > ‘two’
=> “two”
ruby-1.9.2-p0 > ‘three’
=> “three”
ruby-1.9.2-p0 >
$ wc -l ~/.irb-history
100 /home/dima/.irb-history

On Fri, Dec 31, 2010 at 4:05 AM, koulikoff [email protected] wrote:

100 /home/dima/.irb-history
ruby-1.9.2-p0 >
$ wc -l ~/.irb-history
100 /home/dima/.irb-history

Try placing the code in a file called ~/.irbrc

$ cat ~/.irbrc
IRB.conf[:SAVE_HISTORY] = 1000

At…
Linux 2.6.32-27-generic #49-Ubuntu SMP x86_64 GNU/Linux
Using system ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

The ~/.irbrc worked and the history file is called ~/.irb_history #
with underline

But using rvm 1.1.8
and… ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]

At the file
~/.rvm/scripts/irbrc.rb

around line 27 you have

Kernel::at_exit do
maxhistsize = 100
histfile = File::expand_path(".irb-history", ENV[“HOME”])

I changed the maxhistsize to another value and it worked.
But the history file is .irb-history (with hyphen)

This is probably related to the advice at line 14

Use an alternate way to on history saving until save-history is

fixed.

Abinoam Jr.

On Dec 31, 3:50pm, “Abinoam Jr.” [email protected] wrote:

At the file
~/.rvm/scripts/irbrc.rb

around line 27 you have

Kernel::at_exit do
maxhistsize = 100
histfile = File::expand_path(“.irb-history”, ENV[“HOME”])

I changed the maxhistsize to another value and it worked.

Thank you, this worked too for me.
Happy New Year!

You’re welcome!
Have a brilliant year (in all the ruby sense)! :slight_smile: