Beginners question

As the title says my questions may seem obvious at first as I’m self
teaching myself how to program and I’m taking the first steps as of now.

In the context:

Print( 'Enter your name: ’ )
Name = gets()
Puts( “Hello #{name}” )

I understand print was used instead of puts because puts adds a line
feed at the end of the printed string.

My question is, what is the definition of line feed in regards to Ruby?

:x thanks

A carriage-return and line feed is usually “\r\n”. A line feed simply
starts a new line, it’ll move the command prompt down to the next row.

This seems like the right place for my problem.
I installed Ruby 2.1.7 from http://rubyinstaller.org/downloads/
It is my first language so i would like to get immediate feedback. but
when I enter $ irb it just crashes. I have looked at other forum but
nobody had this problem or I did not understand what they said since I
do not know anything about programming…
what can I do about it? (I already tried to turn off my antivirus
programme…)

If you go into the command-line (cmd) first and then execute “irb”, you
should get an error message when it crashes.
Without an error message, there’s nothing I can do to trace the problem.

You wrote that you turned off your antivirus. Which do you use?
I know that some antiviruses had similar issues, on https://antivirus-review.com/ experts wrote some reviews about this

The chomp method cleans up redundant code.

By adding . chomp to your gets will remove the newline code.
print "enter name => " ; usr_input = gets.chomp
puts “my name is #{usr_input}”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs