From: James Nathan Date: 2011-04-12T08:42:24+09:00 Subject: Re: Hello --0-247795532-1302565341=:92879 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable is there a disk that can be sent out for us to use for ruby and ruby on rai= ls. so that we call the information that we need to set up our ruby program= ? James Nathan --- On Sun, 4/10/11, Vincent Manis wrote: From: Vincent Manis Subject: Re: Hello To: "ruby-talk ML" Date: Sunday, April 10, 2011, 5:34 PM On 2011-04-10, at 15:39, James Nathan wrote: > does the Free Ride program for Ruby the command program that I need to ru= n and write my program? > James Nathan James, I'm not sure what your background is, so please accept my apologies = if this answer doesn't suit your needs.=20 Ruby programs are run via the `ruby' command, which takes as an argument th= e name of the file containing your Ruby program. For example, if you put the following contents into a fi= le named `prog.rb' =A0 puts('Hello, world!') =A0 %w(fee fie foe fum).each do |word| =A0 =A0 puts(word+word) =A0 end =A0 puts('And now goodbye')=20 (not an interesting program, but it serves as an example) and run it from a= terminal window (Command Prompt in Windows), you will get output like this= .=20 =A0 utopia:tmp vmanis$ ruby prog.rb =A0 Hello, world! =A0 feefee =A0 fiefie =A0 foefoe =A0 fumfum =A0 And now goodbye I did this on Macintosh OS X (the output is cut&pasted from my Terminal win= dow), but you will get similar results on any system.=20 Now how did you get the program into the file `prog.rb'? You use a text edi= tor for that purpose. I used Emacs, because I know and love it. Others will= get equally good results with Vim, TextMate or TextEdit (on Macs), or one = of many other editors. (I don't really recommend Windows NotePad, because (= a) it is almost featureless, and (b) it really wants to edit text (.txt) fi= les, but no doubt some people can use it happily. Don't try to use Microsof= t Word or OpenOffice as your text editor, these are really not designed for= editing programs. Don't post an email saying `What is the best editor for = Ruby programmers?', unless you want to get a LOT of email where people argu= e that THEIR editor is the best and everyone else's is garbage :) The irb program, provided as a part of the core Ruby package, provides a gr= eat way of experimenting with programs. It also runs in your terminal/Comma= nd Prompt window. Suppose you put the following into prog2.rb: =A0 def greet(who) =A0 =A0 puts("Hello, #{who}") =A0 end Now you can try it out by calling the procedure interactively, by running i= rb.=20 =A0 utopia:tmp vmanis$ irb=20 =A0 irb(main):001:0> load 'prog2.rb' =A0 =3D> true =A0 irb(main):002:0> greet("Gandalf") =A0 Hello, Gandalf =A0 =3D> nil =A0 irb(main):003:0>=20 Not so useful for running a program on its own, but very convenient for try= ing things out and also for debugging.=20 FreeRIDE is intended to be an integrated development environment for Ruby, = including an editor, debugger, and other tools. I don't know its current st= atus, but a look on its web page, freeride.rubyforge,org, seems to indicate= nothing has happened to it since approximately 2006, which suggests it's n= ot something you want to start using. There are a number of supported IDEs = for Ruby out there, including plugins for Eclipse and Visual Studio, as wel= l as commercial products (some of which cost money, others might be availab= le at no cost), from companies such as JetBrains or ActiveState.=20 All of these IDEs sit on top of the actual Ruby package. Their job is to ma= ke a programmer's job more productive. Some people really like them, others= don't. But you don't need them if you want to get started programming in R= uby.=20 I hope you found that useful. Please feel free to email me if you have addi= tional questions. -- vincent --0-247795532-1302565341=:92879--