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


M

Michael R.

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-promptErrno::ENOENT: No such file or directory - --readline
from (irb):1:in `gets'
from (irb):1
(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
 
Ad

Advertisements

R

Roger Pack

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

$ irb --simple-prompt
Errno::ENOENT: No such file or directory - --readline

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

Michael R.

Roger said:
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
 
D

Daniel Berger

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 =3D gets

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

(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 =A0 =A0aws-2.1.12 =A0 =A0highline-1.5.1 =A0 =A0net-ssh-2.0= 17
rubygems-update-1.3.5
actionmailer-2.3.5 =A0capistrano-2.5.10 =A0hpricot-0.8.2
net-ssh-gateway-1.0.1 =A0sqlite3-ruby-1.2.5
actionpack-2.3.5 =A0dnssd-1.3.1 =A0 =A0http_connection-1.3.0 =A0rack-1.0.= 1
uuidtools-2.1.1
activerecord-2.3.5 =A0fastercsv-1.5.1 =A0 =A0libxml-ruby-1.1.3 =A0rails-2= 3.5
xmpp4r-0.5
activeresource-2.3.5 =A0fastthread-1.0.7 =A0mysql-2.8.1 =A0 =A0rake-0.8.7
activesupport-2.3.5 =A0fcgi-0.8.8 =A0 =A0net-scp-1.0.2 =A0 =A0rest-client= -1.0.4
acts_as_ferret-0.4.4 =A0git-1.2.5 =A0 =A0net-sftp-2.0.4 =A0 =A0ruby-openi= d-2.1.7

Tusen takk (1000 thanks),
7thWAP

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

gem install rdp-rb-readline

Regards,

Dan
 
E

Eric Christopherson

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
Errno::ENOENT: No such file or directory - --readline
=A0from (irb):1:in `gets'
=A0from (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.
 
T

TomTom III

Eric said:
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!
 
Ad

Advertisements

M

Michael R.

TomTom said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top