If you’re on Ruby 1.9.2 and have started getting this error when trying to install gems (either by gem install or bundle install), your environment is simply missing the LANG variable and is loading up US-ASCII by default.

To fix this, simply run the command below before installing anything

export LANG=en_US.UTF-8

or to make it more streamlined, add it to your .bashrc or zshrc (if you’re using the zsh shell).