Please don’t use sudo. You’ll see a lot of posts on StackOverflow that suggest you use it, but doing so may mess up your system. Try this instead:
Type atom ~/.bashrc in the terminal and see if the file that opens up in Atom contains the line export PATH="$HOME/.rbenv/bin:$PATH". If it doesn’t, please add it in, restart the terminal, and see if that fixes the issue.