0

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?

Community
  • 1
  • 1
Mike
  • 1,852
  • 1
  • 15
  • 19

1 Answers1

0

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:

# Installs XCode development tools package
xcode-select --install
# Installs Homebrew (skip if you've done this already)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install chruby ruby-install
ruby-install -V # this should show ruby-install: 0.6.0
ruby-install ruby 2.1.7

Add this line to ~/.bashrc:

source /usr/local/opt/chruby/share/chruby/auto.sh

Reload ~/.bashrc:

. ~/.bashrc

Running chruby should now show you ruby-2.1.7 and running ruby -v should show you 2.1.7 too.

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261