Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 232
Juri Bojka Avatar asked Nov 09 '22 07:11

Juri Bojka


1 Answers

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
like image 92
Miguel M. Serrano Avatar answered Nov 15 '22 04:11

Miguel M. Serrano