Good evening. My name is Miyayan. This is my first article on Qiita. Therefore, I think that there are some parts that are not good, but thank you for your cooperation.
--Environment --Reference article
OS : macOS Big Sur ver.11.1 Ruby : 2.6.5p114 Rails : 6.0.0 bundler : 2.1.4, default: 1.17.2 gem : 3.0.3
-Bundler: failed to load command: spring is issued. ..
-Difference between "gem update --system" and "gem update"
I tried to create an application using the new command on rails.
rails _6.0.0_new app name-d mysql
Then, the following text will be displayed in red!
bundler: failed to load command: spring (/Users/username/The directory where you want to create the app/app name/vendor/bundle/ruby/2.6.0/bin/spring)
Do you say that it seems to be an error and not an error? To be honest, I'm a beginner in programming, so I'm not sure what's going on ... However, just the red letters make me sick. Is it possible to create an application without the text like this warning somehow?
From the point of view of the text, I feel that Spring is not working well. However, if you look at the installed Gem,
Installing spring 2.1.1
Is displayed in green, and Spring is included. To be honest, I feel that this warning can be ignored. Looking at the reference article, it is written that the bundler whose version is 2.1.4 is doing something wrong.
So let's play with bundler.
First, let's check the version of bundler.
% gem list bundler
*** LOCAL GEMS ***
bundler (2.1.4, default: 1.17.2)
It is 2.1.4, which is the same as the reference articles. Uninstall this and check the version again.
% gem uninstall bundler
Successfully uninstalled bundler-2.1.4
% gem list bundler
*** LOCAL GEMS ***
bundler (default: 1.17.2)
And then I'll add the latest version of bundler.
% gem install bundler
Let's check the bundler version again here.
% gem list bundler
*** LOCAL GEMS ***
bundler (2.2.3, default: 1.17.2)
bundler has been upgraded to 2.2.3. Now let's create an app with the new command! !! !!
bundler: failed to load command: spring (/Users/username/The directory where you want to create the app/app name/vendor/bundle/ruby/2.6.0/bin/spring)
** Will it come out! !! !! ** Apparently not a bundler. Or even 2.2.3 may have a Spring warning.
** The version of the gem itself ...? ** **
This is the solution in my case. We would appreciate it if you could use it as a reference only.
Check the version of gem.
% gem -v
3.0.3
Try to update the gem.
% gem update --system
Check the gem version again.
% gem -v
3.2.3
It seems that the update is complete. I was skeptical that this would solve the problem, but I will check the bundler version here as well.
% gem list bundler
*** LOCAL GEMS ***
bundler (default: 2.2.3)
**Hmm? ** The notation is a little different. Earlier
bundler (2.2.3, default: 1.17.2)
It seems that this kind of display is the latest version of bundler's default by updating the gem itself.
If you create the app again with the rails new command here, ** The creation was completed without any warning! !! !! **
In conclusion, I'm not sure why it was solved, (1) It was solved by switching the default version of bundler from 1.17.2 to the current latest 2.2.3. (2) It was solved by changing the gem version from 3.0.3 to 3.2.3.
I feel that there are two patterns above.
It was just a solution in my environment, but it's the same bundler: failed to load command: spring I hope it will be helpful to those who have.
** Thank you for visiting! ** **
Recommended Posts