Prompting: Redux! (Recurring Error : Did you create a variable called title?)


These are the errors I'm currently receiving:
Oops, try again. Did you create a variable called title?
(ruby): syntax error, unexpected tIDENTIFIER, expecting $end
...auty and the Beast" => 3} puts "What is your favourite movi...

Does anyone know how to prevent / fix this, as it wasn't initially giving me this error message, and then when I tried changing some of the syntax to be more "efficient" this one popped up! I have refreshed the page several times as was suggested in this post, to no avail (

Thanks in advance for your help!

My code is below:

movies = {"The butterfly effect"=>4, "Beauty and the Beast" => 3}

puts "What is your favourite movie?"
choice = gets.chomp

case choice
when "add"
    puts "Provide a movie title."
    title = gets.chomp
    puts "What is the movie's rating?"
    rating = gets.chomp
    puts "That pair was just added!"
    movies [title] = rating
when "update"
    puts "Updated!"
when "display"
    puts "Movies!"
when "delete"
    puts "Deleted!"
    puts "Error!"


Here's another problem:

$ ruby snaylz.rb 
What is your favourite movie?
bob eats dinner

Other than that I'm not sure how I would reproduce what you describe, perhaps you posted the wrong code.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.