What is the use of Gemfile in rails?
How to use Gemfile?
Firstly, what is a gem?
According to Wikipedia:
RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries
Gemfile
A Gemfile is a file we create which is used for describing gem dependencies for Ruby programs
Now, in very very simple words:
Gem can be thought of as a library which you can use in your code. Example: faker gem
Your code can use the functionality of faker gem to produce fake data.
Now you can list all the gems that your project requires in the gemfile. When you do a bundle install, all the gems in your gemfile are installed for you.