Stefan Wille

Fix for bundle install: ArgumentError: invalid byte sequence in US-ASCII

March 20, 2012

I stumbled across a weird issue with bundler on MacOS X:

$ bundle install
...
Using delayed_job (2.1.4) from https://github.com/collectiveidea/delayed_job.git (at v2.1)
ArgumentError: invalid byte sequence in US-ASCII
An error occured while installing delayed_job (2.1.4), and Bundler cannot continue.
Make sure that `gem install delayed_job -v '2.1.4'` succeeds before bundling.

Because I installed the failing gem from its source at github, I couldn't just install it manually. I managed to fix this by setting

$ export LANG=en_US

Note: Other websites recommend

$ export LANG=en_US.UTF-8.

but this doesn't work for me. I hope this helps.