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
end
#if input is wrong then loops to beginning
if text != String
sortsomething
end
#output for text
puts "This is in alphabetical order: " + text.sort!
puts "This is in reverse order: " + text.sort! {|one , two| two <=> one}