Juri Bojka
Juri Bojka

Reputation: 415

rails docker-compose bundle install error

I have problem with my docker-compose on ruby on rails. when i run

docker-compose run web bundle install

i have information that my gems installed succesfully, but when in next step i run

docker-compose up

then i have information that my container exited with code 1. I looked on docker logs and i get information that

Could not find gem XXXXXXXXX in any list of sources(Bundler::GemNotFound)

what is interesting i don't use this gem.

Moreover when i run bundle install outside container (on my local machine) everything works good. Where could be problem ? Please help

Upvotes: 5

Views: 3736

Answers (2)

sumskyi
sumskyi

Reputation: 1837

I had the similar issue.

The error was in the Dockerfile:

RUN gem update bundler
RUN bundle install

so the gem update bundler line should be removed :/

Upvotes: 0

Miguel M. Serrano
Miguel M. Serrano

Reputation: 87

I had the same problem, and I solved it.

What's your bundle version is running the container? You can check it at the last line in Gemfile.lock "BUNDLED WITH ...". (access with: docker run -ti sfcr_web /bin/bash and run tail -n 2 Gemfile.lock

Maybe your using a diferent gem version at the local machine/docker container.

You can do gem uninstall xxxx if you don't need that gem. Also it could be that your changes doesnt' take effect because your docker-compose is not using the last docker image, try:

  1. docker images, check your previous images
  2. docker rmi your_image_name
  3. docker container prune, to delete your unused containers and start new ones.
  4. docker container up

Upvotes: 1

Related Questions