"`require': no such file to load" while running script/console

Hi,
I setting up a new server on Linux server running SuSE Linux
Entreprise Server 10.
While trying to run script/console I get an error that I don’t
understand.
Any pointers to fix this will be greatly appreciated as really between
a rock and a hard place with RoR.
Thans and Regards,
Onno

user@epf:~> ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux]
user@epf:~> rails -v
Rails 1.2.4
user@epf:~> rails test
create
create app/controllers
… (lines deleted)
create log/test.log
user@epf:~> cd test
user@epf:~/test> ruby script/console
Loading development environment.
/usr/lib/ruby/1.8/irb/completion.rb:10:in require': no such file to load -- readline (LoadError) from /usr/lib/ruby/1.8/irb/completion.rb:10 from /usr/lib/ruby/1.8/irb/init.rb:252:inrequire’
from /usr/lib/ruby/1.8/irb/init.rb:252:in load_modules' from /usr/lib/ruby/1.8/irb/init.rb:250:ineach’
from /usr/lib/ruby/1.8/irb/init.rb:250:in load_modules' from /usr/lib/ruby/1.8/irb/init.rb:21:insetup’
from /usr/lib/ruby/1.8/irb.rb:54:in `start’
from /usr/bin/irb:13
user@epf:~/test>

Looks like ruby wasn’t compiled with readline support. You should make
sure you do have the readline library available and its development
headers etc… When you compile ruby you can tell it where to look for
the readline stuff.

Fred

You are right, it turns out it wasn’t available on that distribution.

To be exact, a readline package was installed, but not the one that
contained the missing file, which turned out to be readline.h, which I
found out by recompiling the readline support:

The following shows that some readline package was installed:
epf:/home/user/migration/soft # rpm -ivh readline-5.2-7.x86_64.rpm
warning: readline-5.2-7.x86_64.rpm: Header V3 DSA signature: NOKEY,
key ID 844c4360
Preparing…
########################################### [100%]
package readline-5.2-7 is already installed
epf:/home/user/migration/soft #

The following showed me the exact file that was missing: readline.h
user@epf:~/migration/soft/ruby-1.8.6/ext/readline> ruby extconf.rb
checking for tgetnum() in -lncurses… yes
checking for readline/readline.h… no
checking for editline/readline.h… no

I was able to locate a RPM containing readline.h using
http://rpm.pbone.net:
ftp://ftp.gwdg.de/pub/linux/misc/suser-jengelh/SUSE-10.2/x86_64/readline-devel-5.2-7.x86_64.rpm.

After installing that I could compile the readline support in Ruby
with ruby extconf.rb:
ruby extconf.rb (in /ruby-1.8.6/ext/readline)
make
sudo make install

So it turns out that for Rails on Linux server running SuSE Linux
Entreprise Server 10 you need to install this manually.

Thanks and Regards,
Onno