The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My first Ruby Program

Code:

print "What is your name? "
# This asks for the persons name.
name = gets
# This Grabs the persons name and assigns it to a variable.
puts " Your Name Is "
puts name
# This tells the person there name.
nfh = File.new("names.out", "w")
# this creates the log file.
nfh.puts name
nfh.close
# This puts there name in the log file that was created.
print "What Is your email Address? "
# this asks the user what there email is.
email = gets
# this gets the email address that they put, and assigns it to a variable.
puts " Your email Address is "
puts email
# this tells them the email address that they put in.
efh = File.new("email.out", "w")
# This creates the log file.
efh.puts email
efh.close
# This puts there email address in the log file.
print "What is your Age? "
# This asks for there Age.
age = gets
# This grabs there age, and assigns it to a variable.
puts " You are "
puts age
puts " years of age "
# This tells them there age.
afh = File.new("age.out", "w")
# This creates the log file.
afh.puts age
afh.close
# this creates the log file.
print "Do you want to know the answers you just typed? "
# Asks them a question.
answer = gets
# Grabs the answer and assigns it to a variable
puts "So your name Email and age are: "
# Tells them something.
print "Your name is: "
print name
# Tells them there name.
print "Your email is: "
print email
# Tells them there email.
print "Your age is: "
print age
# Tells them there age.

It's my first program it may not be much but im happy
What yall think :-P Haha

Wow, I have a question did stuff change? like when a new release came out. And is that why i do not have to normally do all of that stuff? but i just dont know how to do it that way that you are doing lol. I think i need to get a more up to date book

Sweatje that is your first Ruby script? Im going to run it and see exactly what it does This is really interesting. Im also going to be creating another thread, about rails as well, because im going to have a question lol.
Well, If everyone still has there first ruby scripts go ahead and post them lol. I want to see them as well

Im confused on something can you make a web application without rails? because i know that ruby has ERB where you can enbed ruby scripts in html. by doing
<%=>include_whatever.rb<=%> etc. i think thats how i do it lol. Well, is that possible to make applications without rails? or do you need rails?