terminal residue

  • Thread starter Christopher Small
  • Start date
C

Christopher Small

Something really weird just happened - I just installed Ruby 1.9.1 using
(essentially) Hivelogic's method for rolling out my own Ruby install in
my usr/local/src directory on my Mac running Leopard and although
everything seems to be working okay (ruby -v yeilds the correct
version), any time I enter anything into my terminal I get the normal
behavior except that the line

-e:1:in `<main>': undefined method `grep' for "":String (NoMethodError)

shows up at the end of whatever the terminal returns. Even just hitting
enter with nothing typed in at the prompt return the above line. Now,
this looks like a ruby Error message, but I have no idea why the system
would be returning this as it is. I did save the terminal output from
the install process, so I have records of everything that I did and
everything that happened. Has anyone ever seen anything like this or no
how I could get it fixed? Very strange stuff.

Thanks

Chris
 
R

Robert Klemme

2009/8/7 Christopher Small said:
Something really weird just happened - I just installed Ruby 1.9.1 using
(essentially) Hivelogic's method for rolling out my own Ruby install in
my usr/local/src directory on my Mac running Leopard and although
everything seems to be working okay (ruby -v yeilds the correct
version), any time I enter anything into my terminal I get the normal
behavior except that the line

-e:1:in `<main>': undefined method `grep' for "":String (NoMethodError)

shows up at the end of whatever the terminal returns. Even just hitting
enter with nothing typed in at the prompt return the above line. Now,
this looks like a ruby Error message, but I have no idea why the system
would be returning this as it is. I did save the terminal output from
the install process, so I have records of everything that I did and
everything that happened. Has anyone ever seen anything like this or no
how I could get it fixed? Very strange stuff.

I guess that this is related to a change in class String which might
not be reflected in the code that uses it:

$ ruby -ve '"".grep(/x/)'
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]
$ ruby19 -ve '"".grep(/x/)'
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-cygwin]
-e:1:in `<main>': undefined method `grep' for "":String (NoMethodError)
$ ruby19 -ve 'puts String.ancestors'
ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-cygwin]
String
Comparable
Object
Kernel
BasicObject
$

Note the absence of Enumerable in String in 1.9.1. Maybe this helps
you hunt down the issue.

Kind regards

robert
 
C

Christopher Small

Note the absence of Enumerable in String in 1.9.1. Maybe this helps
you hunt down the issue.

Kind regards

robert


Thanks for the help - I forgot that my .bash_login file had some ruby
code in it and sure enough, that was the culprit.

Chris
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top