Def is not recognized as an internal or external command

Hi,
yesterday I installed ruby and I have tested a simple function using
"def" keyword and it worked. Today I tried to associate .rb files to
ruby with these commands:
$ assoc .rb=RubyScript
.rb=RubyScript

$ ftype RubyScript="c:\ruby\bin\ruby.exe" "%1" %*
RubyScript="c:\ruby\bin\ruby.exe" "%1" %*

and I guess I messed up something cause now it throws me this error "def
is not recognized as an internal or external command.".
how can I solve this?

p.s. ruby -v gives me the ruby version so the ruby is installed.

Thank you!!!

···

--
Posted via http://www.ruby-forum.com/.

It sounds like you're typing Ruby commands (e.g. def) at the Windows
command line. You need to either put the commands in a .rb file and run
that, or type irb and type the commands there. IRB is Interactive Ruby, a
REPL.

···

On Thu, Aug 15, 2013 at 11:43 AM, sahar eb <lists@ruby-forum.com> wrote:

Hi,
yesterday I installed ruby and I have tested a simple function using
"def" keyword and it worked. Today I tried to associate .rb files to
ruby with these commands:
$ assoc .rb=RubyScript
.rb=RubyScript

$ ftype RubyScript="c:\ruby\bin\ruby.exe" "%1" %*
RubyScript="c:\ruby\bin\ruby.exe" "%1" %*

and I guess I messed up something cause now it throws me this error "def
is not recognized as an internal or external command.".
how can I solve this?

p.s. ruby -v gives me the ruby version so the ruby is installed.

Thank you!!!

--
Posted via http://www.ruby-forum.com/\.

Eric Christopherson wrote in post #1118791:

It sounds like you're typing Ruby commands (e.g. def) at the Windows
command line. You need to either put the commands in a .rb file and run
that, or type irb and type the commands there. IRB is Interactive Ruby,
a
REPL.

oops, that was it! Thank you so much @Eric!

···

--
Posted via http://www.ruby-forum.com/\.