Sign up ×  I get this error message when trying to access a hash
with user inputted variables: "undefined method `index' for
nil:NilClass (NoMethodError)"  This should illustrate my problem
a little better... once the string "n" is stored in a variable
that variable can't access the hash anymore and returns nil.
Why?   [6] pry(main)> line = "n" => "n" [7] pry(main)>
subway[:line] => nil [8] pry(main)> subway[:"n"] =>
["timessquare", "34th", "28th", "23rd", "unionsquare", "8th"]
[9] pry(main)> line => "n"  This is the .rb file  l = ["8th",
"6th", "unionsquare","3rd","1st"] six =
["grandcentral","33rd","28th","23rd","unionsquare","astorplace"]
subway = {:n=>n, :l=> l, :six=>six}  puts "Where would you like
to go?" destination = gets.strip.chomp.downcase.delete(" ")
puts "What line is that on?" endline =
gets.strip.chomp.downcase.delete(" ")  puts "What station will
you be departing from?" location =
gets.strip.chomp.downcase.delete(" ")  puts "What line is that
on?" startline = gets.strip.chomp.downcase.delet