# sh: irb: command not found error

**URL:** <https://discuss.rubyonrails.org/t/sh-irb-command-not-found-error/51324>\
**Category:** rubyonrails-talk\
**Created:** [April 30, 2010, 3:22pm UTC](https://discuss.rubyonrails.org/t/sh-irb-command-not-found-error/51324 "2010-04-30T15:22:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toulon](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@toulon](https://discuss.rubyonrails.org/u/toulon)\
**Post date:** [April 30, 2010, 3:22pm UTC](https://discuss.rubyonrails.org/t/sh-irb-command-not-found-error/51324/1 "2010-04-30T15:22:40Z")

</div>

I am running ruby 1.8.6 and rails 2.3.5 and just started learning rails

When following the tutorial on [Getting Started with Rails — Ruby on Rails Guides](http://guides.rubyonrails.org/getting_started.html) I tried to run the command script/console and it failed. After some research I found the following solution.

I am posting this as my google search did not turn up any useful on my initial scan

Anyway here goes for what it is worth

$ script/console Loading development environment (Rails 2.3.5) sh: irb: command not found

How to recompile ruby with readline support - this solves the irb issue above

&nbsp;&nbsp;&nbsp;1. Install readline to /usr/local &nbsp;&nbsp;&nbsp;2. Recompile ruby from scratch and use the --with-readline-dir=/usr/ local switch

or if you have downloaded the ruby sources earlier and built it by hand,

&nbsp;&nbsp;&nbsp;1. Go to the ext/readline folder of your ruby source tree &nbsp;&nbsp;&nbsp;2. Type ruby extconf.rb and then run the make && make install procedure for ruby.

See example below

mfnit1 blog $ cd /usr/src/ruby-1.8.6/ext/readline/ mfnit1 readline $ ls depend extconf.rb Makefile mkmf.log readline.c readline.o README README.ja mfnit1 readline $ ruby extconf.rb checking for tgetnum() in -lncurses... yes checking for readline/readline.h... yes checking for readline/history.h... yes checking for readline() in -lreadline... yes checking for rl\_filename\_completion\_function in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_username\_completion\_function in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_completion\_matches in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_deprep\_term\_function in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_completion\_append\_character in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_basic\_word\_break\_characters in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_completer\_word\_break\_characters in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_basic\_quote\_characters in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_completer\_quote\_characters in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_filename\_quote\_characters in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_attempted\_completion\_over in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_library\_version in stdio.h,readline/ readline.h,readline/history.h... yes checking for rl\_event\_hook in stdio.h,readline/readline.h,readline/ history.h... yes checking for rl\_cleanup\_after\_signal()... yes checking for rl\_clear\_signals()... yes checking for rl\_vi\_editing\_mode()... yes checking for rl\_emacs\_editing\_mode()... yes checking for rl\_clear\_signals()... yes checking for replace\_history\_entry()... yes checking for remove\_history()... yes creating Makefile $ cd /usr/src/ruby-1.8.6 $ make $ make install

Test of script/console mfnit1 ruby-1.8.6 $ cd /var/www/html/blog/ mfnit1 blog $ script/console Loading development environment (Rails 2.3.5)
