Here’s an easy fix for when Docker and the sablon gem don’t want to cooperate: just update your locale.
A problem with the sablon gem occured when our team was developing an application locally in a Docker container. The Docker image based on
Debian Jessie didn’t have
locale set which caused an encoding issue in
We updated our Dockerfile with the following lines to make sure
locale is correctly set to
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \ dpkg-reconfigure --frontend=noninteractive locales && \ update-locale LANG=en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 ENV LC_ALL en_US.UTF-8
In Ubuntu, there is the
update-locale tool which lets you do it quickly: (
Today’s Developers’ Notes were delivered by Łukasz, our Web Application Development Team Leader. Watch out for more useful tips in the future!
Experts in software development
We are a 100% remote team of software development experts, providing web & mobile application development and DevOps services for international clients.