Topic: Console doesn
This is an archive from Rails Forum. Check out the new community here!
A forum for Ruby on Rails users
It looks like you have installed Ruby without readline support. Have you tried running irb? The Rails console is basically just the normal irb plus loading of the environment for your application.
Thanks for your answer,
would a subsequent installation of readline make sense?
No, I think Ruby has to be compiled with readline support. What platform are you on? It might be easier to get a precompiled version than messing with it yourself.
thanks again. I
Last edited by DocTom (2007-01-22 05:38:48)
I don't have much experience with Linux myself. There is probably a package system like on other Linux installations that allow you to download and install automatically. But you will have to ask someone other than me for more advice on that.
Check out http://www.ruby-lang.org/en/downloads/ to see if it offers any help for you.
I am having the same issue with readline on a Fedora Core 6.x86_64 machine and am very frustrated that I can't run script/console. I like interacting with my database and creating objects dynamically like I learned from Dave Thomas in the Rails Pragmatic Studio. No can do! Granted, I am a Linux newbie, but I have spent many hours probing the web and trying different techniques:
Re-doing the ./configure with --prefix=/usr/local (just to make sure);
Exporting my PATH variable in .bash_profile with /usr/local/include (where I found readline with a 'find / -name "readline"'), then logging-out & logging-in again;
Doing the same in /etc/profile;
The only clue that something is not right with where readline is installed is when I type "which readline" at the prompt, I get back "no readline in (all my path locations)". However, Ruby, Rails, etc. are located in /usr/local/bin as many of the tutorials suggest. So is irb. I can run irb, but I want to run it in the context of my various applications.
I believe I added readline via yum install. Is it a problem with gcc? I am so confused. Let me know if you find anything.
Okay, Thomas. I've got you a solution:
cp /usr/lib64/ruby/1.8/x86_64-linux/readline.so /usr/local/lib/ruby/1.8/x86_64-linux/readline.so
Again, being a newbie myself, I believe this copies the binary for readline into the ruby library that your rails application is using. Any ways, it worked for me!
Of course, your exact paths will be different, but I just used 'find / -name "readline.so"' to locate mine.
Thanks for find a solution RJR. I was Googling it but at the end I shouldn't have left this nice forum. ;-)
I wouldn't call myself a Linux expert but I think creating a soft link to the library is a little bit more flexible. Just issue the following command (paths may differ):
sudo ln -s /usr/lib64/ruby/1.8/x86_64-linux/readline.so /usr/local/lib/ruby/1.8/x86_64-linux/readline.so
You shouldn't need to copy any libraries (or link them.) I ran into the same problem on Ubuntu 6.10 on AMD64. The key is to install the readline-dev package. I then grabbed the ruby 1.8.5-12 source, did configure; make; make install. That's it. Autocomplete and command recall then worked in irb too!
This thread helped me with the readline problem in the rails console.
However copying the .so file around on my SUSE 10 box, as described above, didn't work.
But the suggestion did give me a clue and I eventually re-made ruby via this configure command:
./configure --prefix=/usr/local --with-readline-dir=/usr/local
which I found at http://blade.nagaokaut.ac.jp/cgi-bin/sc alk/178034
After a "make install" the rails console worked fine.
Hosting provided by aTech Media