Correctly read .ruby-version with trailing newline

The shell version of rbenv will ignore trailing newlines in
.ruby-version files; this changes rbenv.el to do the same.
would `(replace-regexp-in-string "\[[:space:]\n]+\\'" "" text)`work?