I receive the following error when attempting to do string.encode("UTF-8") with a non-ascii character.
LoadError: dlopen(enc/trans/single_byte.so, 9): image not found - enc/trans/single_byte.so
Unlike the answer here, it appears that this file does not exist in my ruby install, or anywhere else on the system for that matter. I'm running ruby 2.1.7 and bundler 1.10.6, running on Mac OSX 10.11.5. I tried reinstalling ruby (using RVM) with no success.
Should this file exist, and if so what do I need to install?
I would suggest trying to install it using chruby + ruby-install. You can use ruby-install to install any Ruby version you would like, and chruby is a small utility for switching between Ruby versions.
I've seen RVM have issues occasionally, and re-installing Ruby with ruby-install seemingly fixes the issues.
I have a guide for that here: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/
Here's the steps in condensed form:
Add this line to
~/.bashrc:Reload
~/.bashrc:Running
chrubyshould now show youruby-2.1.7and runningruby -vshould show you 2.1.7 too.