Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > undefined local variable or method 'rsion' for main:Object

Reply
Thread Tools

undefined local variable or method 'rsion' for main:Object

 
 
Steve Meyer
Guest
Posts: n/a
 
      06-26-2008
I just installed ruby 1.8.6, on RHEL 5.1
my configure command was:
/configure --prefix=/usr/local --enable-pthread --enable-shared
--with-readline-dir=/usr

When I run the version command, after the version info is displayed the
error:
-e:1: undefined local varriable or method 'rsion' for main:Object
(NameError) appears.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Tim Hunter
Guest
Posts: n/a
 
      06-26-2008
Steve Meyer wrote:
> I just installed ruby 1.8.6, on RHEL 5.1
> my configure command was:
> ./configure --prefix=/usr/local --enable-pthread --enable-shared
> --with-readline-dir=/usr
>
> When I run the version command, after the version info is displayed the
> error:
> -e:1: undefined local varriable or method 'rsion' for main:Object
> (NameError) appears.


There is a -v option and a --version option, but no -version option.
(Count the dashes.)

>ruby -v

ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]

>ruby -version

ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]
-e:1: undefined local variable or method `rsion' for main:Object
(NameError)

>ruby --version

ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Tommy Morgan
Guest
Posts: n/a
 
      06-26-2008
[Note: parts of this message were removed to make it a legal post.]

Hi Steve;
If you run `ruby -version`, since you only use a single dash, the word
'version' isn't treated as a single flag but instead as a list of flags. In
this case, it picks up the -v flag, which prints the version information.
Then it tries to process the e flag, which basically says "the rest of this
line is a ruby script to execute." So ruby faithfully attempts to parse
"rsion", which is where you're getting the NameError.

To just get the version info, you can do `ruby -v` or `ruby --version`.

Hope that helps,

--TM

On Thu, Jun 26, 2008 at 12:58 PM, Steve Meyer <(E-Mail Removed)> wrote:

> I just installed ruby 1.8.6, on RHEL 5.1
> my configure command was:
> ./configure --prefix=/usr/local --enable-pthread --enable-shared
> --with-readline-dir=/usr
>
> When I run the version command, after the version info is displayed the
> error:
> -e:1: undefined local varriable or method 'rsion' for main:Object
> (NameError) appears.
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
Jesús Gabriel y Galán
Guest
Posts: n/a
 
      06-26-2008
On Thu, Jun 26, 2008 at 6:58 PM, Steve Meyer <(E-Mail Removed)> wrote:
> I just installed ruby 1.8.6, on RHEL 5.1
> my configure command was:
> ./configure --prefix=/usr/local --enable-pthread --enable-shared
> --with-readline-dir=/usr
>
> When I run the version command, after the version info is displayed the
> error:
> -e:1: undefined local varriable or method 'rsion' for main:Object
> (NameError) appears.


The version command for ruby is:

jesus@jesus-laptop:~$ ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]

-e is used to run ruby code. Like:

jesus@jesus-laptop:~$ ruby -e"puts 'hi'"
hi

It will try to evaluate what is passed after the -e. So you do:

jesus@jesus-laptop:~$ ruby -version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
-e:1: undefined local variable or method `rsion' for main:Object (NameError)

it will do the -v part and then when trying to do the -e part it will
try to evaluate rsion, which obviously results in an error.

Jesus.

 
Reply With Quote
 
Steve Meyer
Guest
Posts: n/a
 
      06-26-2008

Hey everyone thanks I am a newbie to Ruby and did make the forementioned
'ruby -version' error. I'm just glad it's okay
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
undefined local variable or method '_FILE_' Diogo Veras Ruby 2 09-17-2010 04:09 AM
undefined local variable or method `code_words' for main:Ob Abder-rahman Ali Ruby 3 07-06-2010 11:18 AM
undefined local variable or method (filling an array) Thufir Ruby 2 11-10-2007 08:57 PM
Newbie: require 'filename' - undefined local variable or method... Grehom Ruby 10 12-19-2005 08:10 AM
a static local variable in a static method is thread local storage? Patrick Hoffmann C++ 3 08-08-2003 02:37 PM



Advertisments