[RUBY] What I did when I was addicted to the error "Could not find XXX in any of the sources" when I added a Gem and built it

Overview

"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.

Status

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.

What I tried

・ 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.

The one who solved it

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

Conclusion

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.

Reference article

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

Recommended Posts

What I did when I was addicted to the error "Could not find XXX in any of the sources" when I added a Gem and built it
What to do when ‘Could not find’ in any of the sources appears in the development environment with Docker × Rails × RSpec
What to do if Could not find hoge in any of the sources Run `bundle install` to install missing gems. Appears in the docker container
Could not find coderay-1.1.3 in any of the sources (Bundler :: GemNotFound) during co-development
What I was addicted to when introducing the JNI library
What to do when a could not find driver appears when connecting to a DB in a Docker environment
For those who want to use MySQL for the database in the environment construction of Rails6 ~.
Create an Android app for those who don't want to play music on the speaker
I tried to develop a web application from a month and a half of programming learning history
I want to import the pull-down menu items when submitting a form in Rails into CSV and display them from the DB data.
Approximately three and a half months after joining the company, an output article to feed on the reviews
What I did when I was addicted to the error "Could not find XXX in any of the sources" when I added a Gem and built it
What I was addicted to when updating the PHP version of the development environment (Docker) from 7.2.11 to 7.4.x
Memorandum: What I was addicted to when I hit the accounting freee API
A story I was addicted to when testing the API using MockMVC
What I checked when I installed Docker Hub in a Windows 10 home environment but it did not start
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
When internationalizing is supported by Spring Boot, a specific locale is not translated and I am addicted to it
In WSL2, when I did `docker-compose up`, I got an error saying that the sh file was not found.
When I wanted to create a method for Premium Friday, it was already in the Java 8 standard API
What I tried when I wanted to get all the fields of a bean
When composer install/require in the Docker container, it becomes `Could not find package`
I want you to put the story that the error was solved when you stabbed the charger in the corner of your head
I want to find the MD5 checksum of a file in Java and get the result as a string in hexadecimal notation.
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
What I was addicted to when developing a Spring Boot application with VS Code
[Summary] What I noticed and did when I was told that the Oracle JDK was paid
The part I was addicted to in "Introduction to Ajax in Java Web Applications" of NetBeans
A memorandum because I was addicted to the setting of the Android project of IntelliJ IDEA
I was addicted to the NoSuchMethodError in Cloud Endpoints
I was addicted to the record of the associated model
What I did to get out of the first wall I was assigned to the SRE team and bumped into, "What should I start with?"
I added a Jar file to the build path in an Eclipse project, but the situation and what to do when `java.util.zip.ZipException: invalid LOC header (bad signature)` appears.
What I fixed when updating to Spring Boot 1.5.12 ・ What I was addicted to
What I did in the version upgrade from Ruby 2.5.2 to 2.7.1
A story I was addicted to in Rails validation settings
I was addicted to the setting of laradock + VSCode + xdebug
What I was addicted to with the Redmine REST API
The story I was addicted to when setting up STS
What to do when "relation" hibernate_sequence "does not exist" in the ID column of PostgreSQL + JPA
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
Method definition location Summary of how to check When defined in the project and Rails / Gem
Memorandum: When I tried TensorFlow with Tribuo, it didn't work, so I went on a journey to find the head family and lost.
What to do when the changes in the Servlet are not reflected
Summary of problems that I could not log in to firebase
About what I did when creating a .clj file in Clojure
A note when I was addicted to converting Ubuntu on WSL1 to WSL2
What I did when the DB did not start with docker-compose up
I made a gem to post the text of org-mode to qiita
What I did in the migration from Spring Boot 1.4 series to 2.0 series
What I was addicted to when implementing google authentication with rails
What I did in the migration from Spring Boot 1.5 series to 2.0 series
I was addicted to the API version min23 setting of registerTorchCallback
UnsupportedClassVersionError was output when I placed the .war file built with Eclipse on EC2 and executed it.
The story of making it possible to build a project that was built by Maven with Ant
A story that I was addicted to twice with the automatic startup setting of Tomcat 8 on CentOS 8
What to do if Operation not permitted is displayed when you execute a command in the terminal
An error occurred in the free course of RubyOnRails Udemy, solved it, and went through to the end
[Swift] Rather, it is meaningful to avoid var and declare it with let only when there is a branch in the assignment of the initial value.
What to do if you get the error message "Don't try to install it manually: your package manager does it automatically. However, a different version of webpack was detected higher up in the tree:" when you do "npm start" Law
A memo that was soberly addicted to the request of multipart / form-data
I summarized the points to note when using resources and resources in combination
[Rails] I was addicted to the nginx settings when using Action Cable.
The story of forgetting to close a file in Java and failing
I was addicted to a simple test of Jedis (Java-> Redis library)
Problems I was addicted to when building the digdag environment with docker