2

People were reporting this error and solved it by deleting a folder holding cached gems. Since I'm working inside a Docker container, this didn't seem like helpful advice for me. Indeed, the cache folder was not empty but did contain two items (I guess they are there from gem install bundle).

This is my (faulty) dockerfile

FROM nginx

RUN apt-get update -qqy && \
    apt-get install -qqy \
        build-essential \
        ruby-full \
        ruby-dev

RUN gem install bundle

RUN useradd -ms /bin/bash udo

USER udo
WORKDIR /home/udo

COPY . .

RUN bundle install
RUN bundle exec -- jekyll build

USER root
RUN cp -r _site/* /usr/share/nginx/html

I could fix the error by replacing RUN bundle install with

RUN bundle install --path=tmp

at the expense of having this local tmp directory that I then had to add to the exclude list in the _config.yml for Jekyll.

I'd prefer to know what was actually going on. I suspect there's a problem with the way I use the non-root user.

Note: bundle install --no-cache did not help.

ruben.moor
  • 1,876
  • 15
  • 27

0 Answers0