From: Kaye Ng on 26 Jul 2010 06:29 Beginner here (in ANY programming language), so pls bear with me. Please see the first example on this page. http://pine.fm/LearnToProgram/?Chapter=01 It says to type in ruby calc.rb I find it doesn't work. What works are: calc.rb or simply calc Am I wrong? I saved the calc.rb in G:\Ruby\Practice I opened command prompt in Accessories, went to G:\Ruby\Practice , then typed ruby calc.rb G:\Ruby\Practice>ruby calc.rb 'ruby' is not recognized as an internal or external command, operable program or batch file. so I typed calc.rb and it worked. calc also worked. So is the example wrong or am I doing it wrong? Thanks guys! -- Posted via http://www.ruby-forum.com/.
From: Joseph E. Savard on 26 Jul 2010 10:57 You need to set your path top the Ruby bin directory. The error: 'ruby' is not recognized as an internal or external command, operable program or batch file.' Is do to this you must set PATH=%PATH%;c:\ruby\bin or the true path of your installation. The reason your calc.rb at the command line is working is Depending on how you installed windows...1click installs set this up. On Windows it depends whether or not .rb files are associated with ruby. It seems perhaps they are. Since you type calc and cal.rb and it works I believe this to be the best guess. So as I understand it you are are experiencing. $ hello-world.rb Hello world No I would check the the following: $ assoc Look for rb=RubyScript $ ftype Look for RubyScript="c:\ruby\bin\ruby.exe" "%1" %* For more assistance on these commands run "help assoc" and "help ftype". If this does not have either entry. See if that helps > From: Kaye Ng <sbstn26(a)yahoo.com> > Reply-To: <ruby-talk(a)ruby-lang.org> > Newsgroups: comp.lang.ruby > Date: Mon, 26 Jul 2010 19:29:13 +0900 > To: ruby-talk ML <ruby-talk(a)ruby-lang.org> > Subject: ruby calc.rb or just calc.rb > > Beginner here (in ANY programming language), so pls bear with me. > > Please see the first example on this page. > http://pine.fm/LearnToProgram/?Chapter=01 > > It says to type in ruby calc.rb > > I find it doesn't work. > What works are: > calc.rb > or simply > calc > > Am I wrong? I saved the calc.rb in G:\Ruby\Practice > I opened command prompt in Accessories, went to G:\Ruby\Practice , > then typed ruby calc.rb > > G:\Ruby\Practice>ruby calc.rb > 'ruby' is not recognized as an internal or external command, > operable program or batch file. > > so I typed calc.rb and it worked. > calc also worked. > > So is the example wrong or am I doing it wrong? > > Thanks guys! > -- > Posted via http://www.ruby-forum.com/. >
|
Pages: 1 Prev: Beginning meta-programming question Next: ruby calc.rb or just calc.rb |