From: "Crispian A." Date: 2013-07-25T19:22:30+09:00 Subject: Ruby newbie question on Methods (NoMethoderror) I have recently started learning ruby and so I am writing a small little program that takes user input and display on screen. I am using Aptana Studio 3 as well. I am getting a small error that says the following: C:/Users/Gemini/Documents/Aptana Studio 3 Workspace/rubyProject/rubyTest.rb:51:in `
': undefined method `games' for main:Object (NoMethodError) My Code here where the problem exists: puts "Would you like to play a game?(Y/N)" userAnswer = gets.chomp puts "You said #{userAnswer}" if userAnswer == "Y" puts "Please choose from the list below:" games = ["Pacman", "Mario Brothers", "Bomberman"] puts "#{games}" puts "Select between 0 and 2 to select your game of choice" selectGame = games(gets.chomp) puts " You chose #{selectGame(gets.chomp)}" elsif userAnswer == "N" puts "Do you not like games?(Y/N)" userAnswer = gets.chomp else puts "You did not choose an option!" end -- Posted via http://www.ruby-forum.com/.