Newbie mysteries

Good morning!

I'm on a WinXP SP-2 box, and have installed Ruby, Gems, Mondrian editor.

I'm trying to use Gems to install Rails, and getting nowhere.

I'm confused by the apparent lack of an interpreter in Ruby. I thought there was one, but passed by the reference a while back and haven't found it again. Can you enlighten
me on this?

I played around with the Scite editor and seemed only to execute programs. Mondrian, however, seems able to execute whatever's in the focused window. What's going on here?

Now, rails, working in Mondrian...

The page at http://download.rubyonrails.com/ advises executing this, after install of gems ...

gem install rails --include-dependencies

But I can't seem to pull this off.

In Mondrian, still, I get this output:

Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby projects - Toms" "railsinstall.rb"'
railsinstall.rb:1: warning: parenthesize argument(s) for future version
railsinstall.rb:1: undefined method `-@' for Object:Class (NoMethodError)
Execution completed with exit code 1.

As a test, I then run this:

gem (install rails) #--include-dependencies

And get this output:

Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby projects - Toms" "railsinstall.rb"'
railsinstall.rb:1: undefined local variable or method `rails' for main:Object (NameError)
Execution completed with exit code 1.

Can someone tell me what's happening, and what I need to do to get it to work?

-- t.

···

======================================================
Tom Cloyd
Bellingham, Washington, U.S.A: (360) 920-1226
<< BestMindHealth.com / tc@bestmindhealth.com >>

Using Opera's revolutionary e-mail client (program): http://www.opera.com/mail/

Did you use the Window's one-click installer to install ruby? If so,
gems would have been installed with ruby.

If you open a command prompt, typing "ruby" runs the ruby interpreter.
"irb" runs an interactive ruby interpreter. If Ruby Gems is installed,
running "gem" runs Ruby gems.

So, after running the one-click installer for windows:

gem install rails --include-dependencies

should work from any command prompt.

If not, there is a path issue. Ruby is usually installed to C:\ruby by
the installer- check your path.

Never used Mondrian, but some editors allow execution of an arbitrary
buffer or code selection, and others want a saved file (the only
definition of a ruby program I can think of ), so maybe that's the
difference.

Regards,
Nick

···

On 9/11/05, Tom Cloyd <tomcloyd@bestmindhealth.com> wrote:

Good morning!

I'm on a WinXP SP-2 box, and have installed Ruby, Gems, Mondrian editor.

I'm trying to use Gems to install Rails, and getting nowhere.

I'm confused by the apparent lack of an interpreter in Ruby. I thought
there was one, but passed by the reference a while back and haven't found
it again. Can you enlighten
me on this?

I played around with the Scite editor and seemed only to execute programs.
Mondrian, however, seems able to execute whatever's in the focused window.
What's going on here?

Now, rails, working in Mondrian...

The page at http://download.rubyonrails.com/ advises executing this, after
install of gems ...

gem install rails --include-dependencies

But I can't seem to pull this off.

In Mondrian, still, I get this output:

Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby
projects - Toms" "railsinstall.rb"'
railsinstall.rb:1: warning: parenthesize argument(s) for future version
railsinstall.rb:1: warning: parenthesize argument(s) for future version
railsinstall.rb:1: undefined method `-@' for Object:Class (NoMethodError)
Execution completed with exit code 1.

As a test, I then run this:

gem (install rails) #--include-dependencies

And get this output:

Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby
projects - Toms" "railsinstall.rb"'
railsinstall.rb:1: undefined local variable or method `rails' for
main:Object (NameError)
Execution completed with exit code 1.

Can someone tell me what's happening, and what I need to do to get it to
work?

-- t.

======================================================
Tom Cloyd
Bellingham, Washington, U.S.A: (360) 920-1226
<< BestMindHealth.com / tc@bestmindhealth.com >>

Using Opera's revolutionary e-mail client (program):
Opera Web Browser | Faster, Safer, Smarter | Opera

---
Nicholas Van Weerdenburg

i've actually got the same problem,
i used to be able to start ruby, irb or gems just by typing it, but that
doesn't work anymore (windows xp, cmd.exe)
it's really weird, i'm going to try to reinstall ruby, and see if it works
then..

2005/9/11, Nicholas Van Weerdenburg <vanweerd@gmail.com>:

···

On 9/11/05, Tom Cloyd <tomcloyd@bestmindhealth.com> wrote:
> Good morning!
>
> I'm on a WinXP SP-2 box, and have installed Ruby, Gems, Mondrian editor.
>
> I'm trying to use Gems to install Rails, and getting nowhere.
>
> I'm confused by the apparent lack of an interpreter in Ruby. I thought
> there was one, but passed by the reference a while back and haven't
found
> it again. Can you enlighten
> me on this?
>
> I played around with the Scite editor and seemed only to execute
programs.
> Mondrian, however, seems able to execute whatever's in the focused
window.
> What's going on here?
>
> Now, rails, working in Mondrian...
>
> The page at http://download.rubyonrails.com/ advises executing this,
after
> install of gems ...
>
> gem install rails --include-dependencies
>
> But I can't seem to pull this off.
>
> In Mondrian, still, I get this output:
>
> Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby
> projects - Toms" "railsinstall.rb"'
> railsinstall.rb:1: warning: parenthesize argument(s) for future version
> railsinstall.rb:1: warning: parenthesize argument(s) for future version
> railsinstall.rb:1: undefined method `-@' for Object:Class
(NoMethodError)
> Execution completed with exit code 1.
>
> As a test, I then run this:
>
> gem (install rails) #--include-dependencies
>
> And get this output:
>
> Executing 'ruby -C "C:/Documents and Settings/TC/My Documents/Ruby
> projects - Toms" "railsinstall.rb"'
> railsinstall.rb:1: undefined local variable or method `rails' for
> main:Object (NameError)
> Execution completed with exit code 1.
>
> Can someone tell me what's happening, and what I need to do to get it to
> work?
>
> -- t.
>
> ======================================================
> Tom Cloyd
> Bellingham, Washington, U.S.A: (360) 920-1226
> << BestMindHealth.com / tc@bestmindhealth.com >>
> ======================================================
>
> Using Opera's revolutionary e-mail client (program):
> Opera Web Browser | Faster, Safer, Smarter | Opera
>
>

Did you use the Window's one-click installer to install ruby? If so,
gems would have been installed with ruby.

If you open a command prompt, typing "ruby" runs the ruby interpreter.
"irb" runs an interactive ruby interpreter. If Ruby Gems is installed,
running "gem" runs Ruby gems.

So, after running the one-click installer for windows:

gem install rails --include-dependencies

should work from any command prompt.

If not, there is a path issue. Ruby is usually installed to C:\ruby by
the installer- check your path.

Never used Mondrian, but some editors allow execution of an arbitrary
buffer or code selection, and others want a saved file (the only
definition of a ruby program I can think of ), so maybe that's the
difference.

Regards,
Nick
---
Nicholas Van Weerdenburg

As Nicholas said, this does sound like a path problem. Typing "path" at a
command prompt will show your path:
C:\>path
PATH=c:\ruby\bin;C:\WINDOWS\system32;C:\WINDOWS; <etc...>
c:\ruby\bin should appear somewhere in the path (not necessarily as the
first item), if you installed Ruby in the usual c:\Ruby location.
You can also look in your c:\ruby\bin directory, to see that it contains
ruby.exe,
but I can't imagine why it wouldn't be there.
What happens when you try to run ruby from the command prompt?
Wayne Vucenic
No Bugs Software
Ruby and C++ Agile Contract Programming in Silicon Valley

i found a way around it by creating a bat file (my first actual useful
batfile :P) like this:
  @echo off
cd c:\ruby\
doskey rdoc=c:\ruby\bin\rdoc.bat $*
doskey rails=c:\ruby\bin\rails.cmd $*
doskey irb=c:\ruby\bin\irb.bat $*
doskey gem=c:\ruby\bin\gem.cmd $*
doskey fxri=c:\ruby\bin\fxri.cmd $*
doskey rubyw=c:\ruby\bin\rubyw.exe $*
doskey ruby=c:\ruby\bin\ruby.exe $*
doskey freeride=c:\ruby\freeride\freeride.rb $*
doskey scite=c:\ruby\scite\scite.exe $*
so i could run all my stuff just by typing in the commands.
also, in the registry, you could change
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\AutoRun" to run the
bat file when cmd.exe is executed, so you don't have to open it yourself
every time.
i can't believe i've actually programmed something useful.. i feel so smart
:stuck_out_tongue:

2005/9/11, Wayne Vucenic <nightphotos@gmail.com>:

···

As Nicholas said, this does sound like a path problem. Typing "path" at a
command prompt will show your path:
C:\>path
PATH=c:\ruby\bin;C:\WINDOWS\system32;C:\WINDOWS; <etc...>
c:\ruby\bin should appear somewhere in the path (not necessarily as the
first item), if you installed Ruby in the usual c:\Ruby location.
You can also look in your c:\ruby\bin directory, to see that it contains
ruby.exe,
but I can't imagine why it wouldn't be there.
What happens when you try to run ruby from the command prompt?
Wayne Vucenic
No Bugs Software
Ruby and C++ Agile Contract Programming in Silicon Valley

List and Wayne,

As Nicholas said, this does sound like a path problem.

For some reason, Nicholas' email came to me with only the text to which he was replying. It was empty, otherwise, so I never got his email, in effect.

About the hypothesis that I'm having a path problem - I thought this too, and so moved my one line program to "C:\ruby\rubygems-0.8.11\bin", so that "gem" could be in the root and thus be found. It was...but the error message remained the same:

···

---
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: warning: parenthesize argument(s) for future version
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: warning: parenthesize argument(s) for future version
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: undefined method `-@' for Object:Class (NoMethodError)
Execution completed with exit code 1.
---

QUESTION: Where I can find out what these warnings are saying?

Clearly, these is no path problem at this point. Rather, something seems wrong with the statement I'm trying to execute -

gem install rails --include-dependencies

As I said earlier, this is taken exactly as I found it on the Rail web site - exactly.

QUESTIONS
---------

1. HOW can I tell what module is kicking out those warnings, and the "undefined method" message? Is there some default assumption about origin of error messages which I should know about?

2. Is there some documentation source for the error messages?

3. On the assumptions that it was gem which was having a problem, I scoured the unzipped source folders, etc. for meaningful documentation, and amazed to find nothing - except a reference to the rubygems website. There, I found a " Command reference" for a version of gem which is FOUR versions older than the current one. There was NO comment about whether this was to be trusted, no mention of when it might be updated, or if this was needed. How helpful is THIS supposed to be? Sounds like documentation hell to me.
    The "RubyGems User Guide" contains a link to the "gem Command Reference" - which is the same apparently severely out of date page mentioned in the previous paragraph.

CONCLUSION
----------

I'm left with the presumption, at thie point, that the latest version of gem has some command line requirements which are documented nowhere, and not recognized by the Rails site.

I'm completely stuck at this point.

All suggestions welcome.

-- t.

======================================================
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< BestMindHealth.com / tc@bestmindhealth.com >>

Using Opera's revolutionary e-mail client (program): Opera Web Browser | Faster, Safer, Smarter | Opera

Tom Cloyd schrieb:

List and Wayne,

As Nicholas said, this does sound like a path problem.

For some reason, Nicholas' email came to me with only the text to which he was replying. It was empty, otherwise, so I never got his email, in effect.

About the hypothesis that I'm having a path problem - I thought this too, and so moved my one line program to "C:\ruby\rubygems-0.8.11\bin", so that "gem" could be in the root and thus be found. It was...but the error message remained the same:

---
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: warning: parenthesize argument(s) for future version
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: warning: parenthesize argument(s) for future version
C:/ruby/rubygems-0.8.11/bin/railsinstall.rb:1: undefined method `-@' for Object:Class (NoMethodError)
Execution completed with exit code 1.
---

QUESTION: Where I can find out what these warnings are saying?

Hi Tom,

you can't put the line into a Ruby script because it's not Ruby code. You're supposed to enter it in the DOS shell or put it into a DOS script.

HTH

Regards,
Pit

Pit:

[snip]

you can't put the line into a Ruby script because it's not Ruby code. You're supposed to enter it in the DOS shell or put it into a DOS script.

Nuts. How right you are.

I'm learning Ruby as fast as possible, and I got really muddled on this one.

Rails is now installed nicely, and I'm moving forward.

Thanks!

-- t.

···

======================================================
Tom Cloyd
Bellingham, Washington, U.S.A: (360) 920-1226
<< BestMindHealth.com / tc@bestmindhealth.com >>

Using Opera's revolutionary e-mail client (program): Opera Web Browser | Faster, Safer, Smarter | Opera

Glad you got it working.
It does seem to me that http://download.rubyonrails.com/ would be
clearer on this point if they said "Run the following from a command
prompt:"
Wayne

Yeah. As a newbie, I note in ruby documentation a variable neglect of Windows folk. for what it's worth, I'm writing up what I did and will submit it to whoever (need to figute that out) as a possible amendment. People shouldn't have to go through what I just went through to get this thing going.

Onward...

-t

···

On Sun, 11 Sep 2005 12:51:25 -0700, Wayne Vucenic <nightphotos@gmail.com> wrote:

Glad you got it working.
It does seem to me that http://download.rubyonrails.com/ would be
clearer on this point if they said "Run the following from a command
prompt:"
Wayne

--

======================================================
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< BestMindHealth.com / tc@bestmindhealth.com >>

Using Opera's revolutionary e-mail client (program): Opera Web Browser | Faster, Safer, Smarter | Opera