I have been working with Rails and it sends me back this error. Please provide questions. Thanks for all the help. I will update this question with a better one because I do
Remove your Gemfile.lock.
Move to bash if you are using zsh.
sudo bash gem update --system
Now run command bundle to create a new Gemfile.lock file. Move back to your zsh sudo exec zsh now run your rake commands.
sudo exec zsh