March 2, 2012
Bundler install error: ArgumentError: invalid byte sequence in US-ASCII

I upgraded my Rails app to 3.2.2 and was doing a deploy via Capistrano and during the bundler install process the deploy bombed out with the following error:

** [out] ArgumentError: invalid byte sequence in US-ASCII
** [out] An error occured while installing will_paginate (3.0.3), and Bundler cannot continue.
** [out] Make sure that `gem install will_paginate -v '3.0.3'` succeeds before bundling.

I think the reference to will_paginate is really a red-herring. Anyways, the solution is to properly set the default environment in Capistrano which gets passed to the environment that Capistrano+Bundler use in the deploy.

Specifically you need to set the LANG attribute.

Add this to your Capfile. Note that the PATH is not strictly necessary, but I had that block in there already.

  1. ruckus posted this