Errno::ENOENT: No such file or directory - --readline

I cannot find a resolution to this problem and figured someone here
probably can tell me what I need to do to fix it; there are so many
intelligent, learned and helpful people here. (Thanks in advance.)

I’ve searched Google and run the MacOS Software Updates, (I’m on a newly
purchased system, recently upgraded from Leopard to Snow Leopard). I
also reinstalled Xcode. Then I updated all my gems (though I’m not sure
they all worked right – should I install them as root or myself?). I’m
a newbie to Ruby and to the Mac, (though I’ve run many other Unix
systems), so I’m not sure I’ve checked everything… (apparently not).

Any call to ‘gets’ results in the error, below, (I also pasted version
info)

$ irb --simple-prompt

person = gets
Errno::ENOENT: No such file or directory - --readline
from (irb):1:in `gets’
from (irb):1

^D

(MacOS X version 10.6.2)

$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

$ pwd
/Library/Ruby/Gems/1.8/gems

$ ls
RedCloth-4.2.2 aws-2.1.12 highline-1.5.1 net-ssh-2.0.17
rubygems-update-1.3.5
actionmailer-2.3.5 capistrano-2.5.10 hpricot-0.8.2
net-ssh-gateway-1.0.1 sqlite3-ruby-1.2.5
actionpack-2.3.5 dnssd-1.3.1 http_connection-1.3.0 rack-1.0.1
uuidtools-2.1.1
activerecord-2.3.5 fastercsv-1.5.1 libxml-ruby-1.1.3 rails-2.3.5
xmpp4r-0.5
activeresource-2.3.5 fastthread-1.0.7 mysql-2.8.1 rake-0.8.7
activesupport-2.3.5 fcgi-0.8.8 net-scp-1.0.2 rest-client-1.0.4
acts_as_ferret-0.4.4 git-1.2.5 net-sftp-2.0.4 ruby-openid-2.1.7

Tusen takk (1000 thanks),
7thWAP

Any call to ‘gets’ results in the error, below, (I also pasted version
info)

$ irb --simple-prompt

person = gets
Errno::ENOENT: No such file or directory - --readline

Do you get this if you have gets just in a file (like yo.rb)?
-r

Roger P. wrote:

Any call to ‘gets’ results in the error, below, (I also pasted version
info)

$ irb --simple-prompt

person = gets
Errno::ENOENT: No such file or directory - --readline

Do you get this if you have gets just in a file (like yo.rb)?
-r

Good call… It appears to work that way!?! What does that mean?

$ vi yo.rb
$ cat yo.rb
#!/usr/bin/ruby -w
puts ‘Try plain old gets’
input = gets
puts “Got #{input}”
$ chmod 755 yo.rb
$ yo.rb
Try plain old gets
hello
Got hello

On Mon, Feb 1, 2010 at 6:04 PM, Michael R. [email protected] wrote:

Any call to ‘gets’ results in the error, below, (I also pasted version
info)

$ irb --simple-prompt

person = gets
Errno::ENOENT: No such file or directory - --readline
�from (irb):1:in `gets’
�from (irb):1

It appears that somewhere along the line you have a program invoking
another program with the argument --readline, but for some reason it’s
interpreting that as a filename instead of a switch. I’m not sure
where that is happening, though.

On Feb 1, 5:04 pm, “Michael R.” [email protected] wrote:

rubygems-update-1.3.5
Tusen takk (1000 thanks),
7thWAP

If all else fails, there’s rb-readline.

gem install rdp-rb-readline

Regards,

Dan

Eric C. wrote:

On Mon, Feb 1, 2010 at 6:04 PM, Michael R. [email protected] wrote:

Any call to ‘gets’ results in the error, below, (I also pasted version
info)

$ irb --simple-prompt

person = gets
Errno::ENOENT: No such file or directory - --readline
�from (irb):1:in `gets’
�from (irb):1

It appears that somewhere along the line you have a program invoking
another program with the argument --readline, but for some reason it’s
interpreting that as a filename instead of a switch. I’m not sure
where that is happening, though.

AHH! THAT’S IT!

I ran the command:
$ find / -xdev -type f -exec grep -l readline {} ;
… then checked all the files it indicated contained the word
“readline” inside, and found a file (which I did not create), named
“.irbrc”, which contains (among other things), the lines:

Prompt behavior

ARGV.concat [ “–readline”, “–prompt-mode”, “simple” ]

When I renamed that file, my irb sessions began to work correctly!

Thanks for the help. I doubt I would have found it without the tips in
the right direction!

TomTom III wrote:

AHH! THAT’S IT!

I ran the command:
$ find / -xdev -type f -exec grep -l readline {} ;
… then checked all the files it indicated contained the word
“readline” inside, and found a file (which I did not create), named
“.irbrc”, which contains (among other things), the lines:

Prompt behavior

ARGV.concat [ “–readline”, “–prompt-mode”, “simple” ]

When I renamed that file, my irb sessions began to work correctly!

Thanks for the help. I doubt I would have found it without the tips in
the right direction!

Thank you. That seems to be what caused my problem. I deleted the .irbrc
(it was a link on my system), and irb works correctly. The date stamp on
the files seems to be when I installed some vi/vim enhancement, (I do
not recall the package name). Have you installed any vi or vim packages
recently?