0

I'am setting up docker for my rails project. I'm getting error:

/usr/local/bundle/gems/bundler-1.12.5/lib/bundler/ui/shell.rb:99:in `[]': invalid byte sequence in US-ASCII (ArgumentError)
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/ui/shell.rb:99:in `strip_leading_spaces'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/ui/shell.rb:104:in `word_wrap'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/ui/shell.rb:90:in `tell_me'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/ui/shell.rb:35:in `error'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:21:in `log_error'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:100:in `rescue in with_friendly_errors'
    from /usr/local/bundle/gems/bundler-1.12.5/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
    from /usr/local/bundle/gems/bundler-1.12.5/exe/bundle:19:in `<top (required)>'
    from /usr/local/bundle/bin/bundle:22:in `load'
    from /usr/local/bundle/bin/bundle:22:in `<main>'

i tried to run locale-gen and setting locale for my docker environment, but it failed. here is my Dockerfile:

FROM ruby:2.2.4
CMD ["/bin/bash", "locale-gen", "en_US.UTF-8"]
RUN ruby --version
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /keypoints
WORKDIR /keypoints
ADD Gemfile /keypoints/Gemfile
ADD Gemfile.lock /keypoints/Gemfile.lock

RUN gem install bundler
RUN gem update bundler
RUN gem install puma
ADD . /keypoints
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN bundle install

anyone successfully deployed ruby on rails docker? it seems to fail at

RUN bundle install

thanks

James Tan
  • 101
  • 5

1 Answers1

0

I was able to resolve my encoding issue with this stuff inside the container:

export LANG="C.UTF-8"
export LC_ALL="C.UTF-8"