What is the use of Gemfile in rails?
How to use Gemfile?
I'll try and give a simple answer
Explanation by analogy
Let's suppose you want to make a car. From scratch. Now that will be a nightmare. You need to build: the chasis, the engine, the corroborator, radiator, cooling, ventilation, etc etc. etc.
Gems allow you to utilise car parts which other people have made before
But you're not the only one building a car. Everyone's who's ever built a car has basically made the same things. There have been smart people who've gone out there and made combustion engines etc well before you were...........actually never mind.
You needn't reinvent the wheel. Why make your own when you can simply get the best equipment straight off the shelf? What if you could get one of the best engines around, created by the most talented engineers in the world, without lifting a finger? Are you gonna spend a year trying to make your own?
So basically rather than make everything yourself, you write down a shopping list of all the parts you need. And that is basically a gem file:
That my friend, is basically your gem file!