I get a variable error on line 8. I thought the @ turns the variable into a global variable?

#takes in a number of strings and sorts them alphabetically
def sortsomething
puts "Give me something to sort."
text = gets.chomp
@text = text
#if input is wrong then loops to beginning
if text != String
#output for text
puts "This is in alphabetical order: " + text.sort!
puts "This is in reverse order: " + text.sort! {|one , two| two <=> one}