A gem is a ruby library
.
It will be a library of rails, but rails was originally a library of ruby.
Since it is one, it is necessary to recognize that it is a ruby library correctly.
It is the one that manages gems
.
For example, using bundler has the following advantages.
** 1. If you install gems using bundler, they will maintain compatibility between gems, so You can add gems and develop without error over time ** (Supplement) For example, if you have a gem called A, you need to use a gem called B to use A. To use that gem, when the gem C is ... This means that A depends on B and B depends on C.
** 2. Gem is easy to manage because gem is written in one file called Gemfile **
** 3. You can manage gems for each app using Gemfile **
** 4. You can manage the gems to be installed for each environment. ** **
A common cause is that there is no version of the gems.
So if you get an error with the bundle install command, first of all
The point is to check inside the gem file
.
It may also be resolved by deleting Gemfile.lock.
In the file Gemfile.lock
in the Ruby on Rails file, Gem
Version specification is managed.
So, delete the Gemfile.lock file and then do bundle install
again
Let's look.
gem is a ruby library, which is a collection of many programs. And bundler manages the type and version of the library.
If you compare it with Homebrew or iphone on MacOS, the App store is in ruby. It is an image that becomes a bundler. The bundle install command that I casually use is a library managed by bundler. I found that it was a command to find and install in the gemfile.
Recommended Posts