Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2598 > unrolled thread

Re: Hello

Started byJames Nathan <badlands_2004@yahoo.com>
First post2011-04-10 17:39 -0500
Last post2011-04-10 18:34 -0500
Articles 2 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  Re: Hello James Nathan <badlands_2004@yahoo.com> - 2011-04-10 17:39 -0500
    Re: Hello Vincent Manis <vmanis@telus.net> - 2011-04-10 18:34 -0500

#2598 — Re: Hello

FromJames Nathan <badlands_2004@yahoo.com>
Date2011-04-10 17:39 -0500
SubjectRe: Hello
Message-ID<13641.20185.qm@web65903.mail.ac4.yahoo.com>
[Note:  parts of this message were removed to make it a legal post.]

does the Free Ride program for Ruby the command program that I need to run and write my program?
James Nathan

--- On Thu, 4/7/11, James Nathan <badlands_2004@yahoo.com> wrote:

From: James Nathan <badlands_2004@yahoo.com>
Subject: Re: Hello
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Date: Thursday, April 7, 2011, 7:29 PM

I am having a hard time to get it up and running. that is Ruby and Ruby on Rails. it seems that no one is willing to help so that we can enjoy this porgram. If their anyway that I can get it downloaded to me, some help to make sure that have the right porgrams. 
James Nathan

--- On Wed, 4/6/11, James Nathan <badlands_2004@yahoo.com> wrote:

From: James Nathan <badlands_2004@yahoo.com>
Subject: Re: Hello
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Date: Wednesday, April 6, 2011, 9:53 PM

hello I am trying to get it stated myself, but I am not sure if I am setting Ruby up right. 

--- On Wed, 4/6/11, Moises Montenegro <moemonty@gmail.com> wrote:

From: Moises Montenegro <moemonty@gmail.com>
Subject: Hello
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Date: Wednesday, April 6, 2011, 4:09 PM

Hello,

I'm new to the Ruby community, but I am very adamant about joining.
I apologize for the inital #help command that was incorrectly sent here.

I'm a full-time web developer in Chicago.

I hope to contribute in the future.

Thanks,
Moises Montenegro

[toc] | [next] | [standalone]


#2602

FromVincent Manis <vmanis@telus.net>
Date2011-04-10 18:34 -0500
Message-ID<EF41CBA8-40AC-4E8F-999F-730B065B55C3@telus.net>
In reply to#2598
On 2011-04-10, at 15:39, James Nathan wrote:

> does the Free Ride program for Ruby the command program that I need to run 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. 

Ruby programs are run via the `ruby' command, which takes as an argument the name of the file containing
your Ruby program. For example, if you put the following contents into a file named `prog.rb'

  puts('Hello, world!')
  %w(fee fie foe fum).each do |word|
    puts(word+word)
  end
  puts('And now goodbye') 

(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. 

  utopia:tmp vmanis$ ruby prog.rb
  Hello, world!
  feefee
  fiefie
  foefoe
  fumfum
  And now goodbye

I did this on Macintosh OS X (the output is cut&pasted from my Terminal window), but you will get similar results on any system. 

Now how did you get the program into the file `prog.rb'? You use a text editor 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) files, but no doubt some people can use it happily. Don't try to use Microsoft 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 argue 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 great way of experimenting with programs. It also runs in your terminal/Command Prompt window. Suppose you put the following into prog2.rb:

  def greet(who)
    puts("Hello, #{who}")
  end

Now you can try it out by calling the procedure interactively, by running irb. 

  utopia:tmp vmanis$ irb 
  irb(main):001:0> load 'prog2.rb'
  => true
  irb(main):002:0> greet("Gandalf")
  Hello, Gandalf
  => nil
  irb(main):003:0> 

Not so useful for running a program on its own, but very convenient for trying things out and also for debugging. 

FreeRIDE is intended to be an integrated development environment for Ruby, including an editor, debugger, and other tools. I don't know its current status, 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 not 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 well as commercial products (some of which cost money, others might be available at no cost), from companies such as JetBrains or ActiveState. 

All of these IDEs sit on top of the actual Ruby package. Their job is to make 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 Ruby. 

I hope you found that useful. Please feel free to email me if you have additional questions. -- vincent

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web