I am confused as to why this won't work, please help


My code looks correct, however i get this code

puts text = gets.chomp

puts redact = gets.chomp

words = text.split(" ")

words.each do
    if text == redacted
        print "REDACTED"
        print word + " "


error i get is

Oops, try again.
    Your syntax doesn't look quite right--check the Hint if you need help.
(ruby):11: syntax error, unexpected $end, expecting keyword_end


Hi Killerdevildog11,

You've got a couple problems in your code:

  1. You should declare a variable equal to something and puts it, then make it equal to gets.chomp (see below for help on that)
  2. The redacted variable you're trying to access on line 8 doesn't exist
  3. And you forgot to close your if/else block

#1 Hint

You can do that like this:

puts variable_name = "instructional text"
variable_name = gets.chomp



Thanks man, I ended up getting that a couple weeks ago but I figured it out.