Are you using rvm? I came across your post because I got the same error and I end up finding that the version I selected using rvm was causing the error.
rvm
To solve it, I ran rvm use system and everything is working now.
rvm use system