# Upper arrow key is not worked in irb. is it bug?

**URL:** <https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264>\
**Category:** ruby-talk\
**Created:** [24 December 2007 18:16 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264 "2007-12-24T18:16:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pokkai\_Dokkai](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@Pokkai\_Dokkai](https://rubytalk.org/u/Pokkai_Dokkai)\
**Post date:** [24 December 2007 18:16 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/1 "2007-12-24T18:16:21Z")

</div>

i manually download ruby-1.8.6.tar.gz

i installed into /home/username/package/ruby (using --prefix)  
and add the manual path into PATH variable

when i was working in irb

if i press upper arrow key then '^[[A' will come .after that if i press  
enter then my irb will quit.

username@ubuntu7.04:~$ which irb  
/home/username/package/ruby/bin/irb  
username@ubuntu7.04:~$ irb  
irb(main):001:0\> 5  
=\> 5  
irb(main):002:0\> ^[[A -----\>here i pressed upper arrow key  
username@subuntu7.04:~$

is it bug ? or is there any solution for this ?  
(because i want to work in irb for long time)

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [24 December 2007 18:36 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/2 "2007-12-24T18:36:58Z")

</div>

Pokkai Dokkai wrote:

> i manually download ruby-1.8.6.tar.gz
> 
> i installed into /home/username/package/ruby (using --prefix)  
> and add the manual path into PATH variable
> 
> when i was working in irb
> 
> if i press upper arrow key then '^[[A' will come .after that if i press  
> enter then my irb will quit.

Do you have the readline and readline-devel packages installed? If you install them (whether using your OS's package manager or building from source), then when you build ruby it will recognize them and irb will use readline, which should give you the desired up-arrow behavior.

On my Ubuntu system these packages are called libreadline5 and libreadline5-dev.

You can check in your ruby-1.8.6/ext/readline whether the ruby wrapper got built or not. Just run 'ruby extconf.rb' there and see if some checks fail.

After installing the readline packages, these checks should succeed. In that case, do 'make && make install' in the same dir and irb should work right.

> **···**
>
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

---

<div class="post-metadata">

**Author:** ![Pokkai\_Dokkai](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@Pokkai\_Dokkai](https://rubytalk.org/u/Pokkai_Dokkai)\
**Post date:** [24 December 2007 20:07 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/3 "2007-12-24T20:07:52Z")

</div>

Joel VanderWerf wrote:

> Do you have the readline and readline-devel packages installed? If you  
> install them (whether using your OS's package manager or building from  
> source), then when you build ruby it will recognize them and irb will  
> use readline, which should give you the desired up-arrow behavior.
> 
> On my Ubuntu system these packages are called libreadline5 and  
> libreadline5-dev.
> 
> You can check in your ruby-1.8.6/ext/readline whether the ruby wrapper  
> got built or not. Just run 'ruby extconf.rb' there and see if some  
> checks fail.
> 
> After installing the readline packages, these checks should succeed. In  
> that case, do 'make && make install' in the same dir and irb should work  
> right.

thank you Joel VanderWerf ..now irb working well .but

I am going to use ri ,it tell to "make install-doc"

when i type "make install-doc" at finally  
below errors are raised

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mmmmc................................c....c..c...  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zlib.c:  
mcccccccccccccccccc...................................................................................  
Generating RI...  
/home/username/package/ruby-1.8.6-p111/lib/yaml.rb:9:in `require': no  
such file to load -- stringio (LoadError)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from /home/username/package/ruby-1.8.6-p111/lib/yaml.rb:9  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/ri/ri\_descriptions.rb:1:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/ri/ri\_descriptions.rb:1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/ri/ri\_reader.rb:1:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/ri/ri\_reader.rb:1  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/generators/ri\_generator.rb:46:in  
`require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/generators/ri\_generator.rb:46  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/rdoc.rb:273:in `require'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from  
/home/username/package/ruby-1.8.6-p111/lib/rdoc/rdoc.rb:273:in  
`document'  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from ./bin/rdoc:63  
make: \*\*\* [rdoc] Error 1  
username@supermail:~/package/ruby-1.8.6-p111$

thank you

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Pokkai\_Dokkai](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@Pokkai\_Dokkai](https://rubytalk.org/u/Pokkai_Dokkai)\
**Post date:** [24 December 2007 20:10 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/4 "2007-12-24T20:10:19Z")

</div>

i tried to install 'stringio' and some related package  
(by synaptic package manager in ubuntu7.04) .

but can't get corresponding package to solve above error.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Pokkai\_Dokkai](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@Pokkai\_Dokkai](https://rubytalk.org/u/Pokkai_Dokkai)\
**Post date:** [24 December 2007 20:18 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/5 "2007-12-24T20:18:00Z")

</div>

actually when i install

i opened "ext/Setup" file and changed from  
#option nodynamic  
to  
option nodynamic

at first line ....  
so i got this error .

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Ryan\_Davis1](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/ryan_davis1/32/1848_2.png) [@Ryan\_Davis1](https://rubytalk.org/u/Ryan_Davis1)\
**Post date:** [24 December 2007 20:25 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/6 "2007-12-24T20:25:50Z")

</div>

this is \_precisely\_ why I won't use ubuntu for ruby development.

what an f'in PITA.

> **···**
>
> On Dec 24, 2007, at 12:10 , Pokkai Dokkai wrote:
> 
> > i tried to install 'stringio' and some related package  
> > (by synaptic package manager in ubuntu7.04) .
> > 
> > but can't get corresponding package to solve above error.

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [24 December 2007 20:41 UTC](https://rubytalk.org/t/upper-arrow-key-is-not-worked-in-irb-is-it-bug/43264/7 "2007-12-24T20:41:42Z")

</div>

Ryan Davis wrote:

> > i tried to install 'stringio' and some related package  
> > (by synaptic package manager in ubuntu7.04) .
> > 
> > but can't get corresponding package to solve above error.
> 
> this is \_precisely\_ why I won't use ubuntu for ruby development.
> 
> what an f'in PITA.

There's no need to reference unspeakable acts with middle-eastern flatbreads, or any baked good.

A simple rule for happiness: build ruby from source, and let it go in /usr/local (or anywhere but /usr). For the developer, that has the advantage, on any OS, of (a) letting you tinker with the interpreter and (b) building with architecture-specific optimizations.

Use apt-get (or whatever) to get the few dependencies that are not commonly installed (such as readline), or build them yourself.

> **···**
>
> > On Dec 24, 2007, at 12:10 , Pokkai Dokkai wrote:
> 
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
