"Could not find XXX in any of the sources" came out and I was addicted to it for about an hour and a half, so I will make a note of the solution process.
I added "rails-controller-testing" to the Gemfile, docker-compose build, confirmed that the build was completed, and ran the test, but got an error.
Could not find rails-controller-testing-1.0.5 in any of the sources Run `bundle install` to install missing gems.
It seems that it is said that the added Gem cannot be found. Follow the instructions to run docker-compose run web bundle install. I ran the test again and got the same error.
・ Is the writing style specified in the Gemfile? → No problem. It is described as specified. ・ Is the version of rails-controller-testing-1.0.5 supported? → I checked on rubygems.org, but there is no problem because 1.0.5 is supported. ・ What happens if I stop spring and try it? → When I try to stop spring, I get the above error, so I can't stop it in the first place. ・ Is the bundle path correct? → I checked with which bundle, but there is no problem because I am looking under ./rbenv. ・ Isn't there a strange cache left? → docker-compose build — No-cache is executed, but it doesn't change.
I deleted Gemfile.lock, bundle installed it again, and ran the test and got another error.
ERROR: No container found for web_1
It seems that it is said that the container cannot be found this time.
I decided to start the container with docker-compose up and check what kind of log is output. Then, confirm that you are throwing the following error.
web_1 | Could not find sass-rails-5.1.0 in any of the sources web_1 | Run `bundle install` to install missing gems. rails_web_1 exited with code 7
It seems that it is said that another Gem cannot be found this time. .. .. I followed the instructions this time and bundle installed and restarted the container, but the error did not change.
I wondered if the version changed with bundle install, so I checked the version of sass-rails on rubygems.org, but 5.1.0 is supported.
Since install didn't work, I tried build somehow and the error disappeared and I was able to start the container normally. When I ran the test, I was able to test it successfully.
Finished in 0.67023 seconds (files took 17.96 seconds to load) 3 examples, 0 failures
I don't know why the cause was solved, but in my case I could solve it by deleting Gemfile.lock and building with bundle install.
There is too little information such as "Could not find XXX in any of the sources", so please throw a longer error.
https://carefree-se.hatenablog.com/entry/2015/07/22/125904 https://qiita.com/jnchito/items/44ab1df134369ed76911 https://qiita.com/nakanowax/items/fe07e8ccd1721befebeb https://fuqda.hatenablog.com/entry/2019/03/21/204118