Skip to content

Instantly share code, notes, and snippets.

@thomaswitt
Last active October 11, 2015 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thomaswitt/3867131 to your computer and use it in GitHub Desktop.
Save thomaswitt/3867131 to your computer and use it in GitHub Desktop.
Getting Umlauts/UTF-8 in irb or rails/console on the mac using rbenv
RUBY_VERSION="1.9.3-p362"
###Use this for global readline for later reuse
# OPT_DIR=/usr/local/ruby-opt/
OPT_DIR=${HOME}/.rbenv/versions/${RUBY_VERSION}/
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
cd /tmp
curl -O 'ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz'
tar xf readline-6.2.tar.gz
cd readline-6.2
export MACOSX_DEPLOYMENT_TARGET=10.5
export CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp"
export CCFLAGS="-arch x86_64 -g -Os -pipe"
export CXXFLAGS="-arch x86_64 -g -Os -pipe"
export LDFLAGS="-arch x86_64 -bind_at_load"
./configure --prefix=${OPT_DIR}
cd shlib
sed -e 's/-dynamic/-dynamiclib/' Makefile > Makefile.good
mv Makefile.good Makefile
cd ..
make -j 2 && make install
cd ..
export CONFIGURE_OPTS="--with-opt-dir=${OPT_DIR} --with-readline-dir=${OPT_DIR} --enable-shared --disable-install-doc"
rbenv install -k ${RUBY_VERSION}
rbenv global ${RUBY_VERSION}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment