Saying it is correct and to move on, but getting error message on screen


#1

puts "Welcome to FaceBook! Enter your username:"
user_name = gets.chomp

puts "Password, please!"
password = gets.chomp

words = text.split(" ")

words.each do |word|
print #|word|
end

error is:
undefined local variable or method `text' for #

please help!


#2

Well the error is telling you where your mistake is:

text is undefined when you try to use it here:

words = text.split(" ")

#3

2 errors here. 1st is words = text.split(" "). change 'text' to 'user_name'. 2nd is print #|word|. change to print "{word}"

Code :
puts "Welcome to FaceBook! Enter your username:"
user_name = gets.chomp

puts "Password, please!"
password = gets.chomp

words = user_name.split(" ")

words.each do |word|
print "#{word}"
end