I have this code
def longest_word(sentence)
long_word = ""
sentence.split(" ").sort_by {|x| x.length}
long_word = sentence.pop
return long_word
end
p longest_word("hello dogs are fast")
And I get the error that the method 'pop' is undefined when I try running it. Does this have something to do with gemfiles? I thought I set that stuff up already.