What is the use of Gemfile in rails?

前端 未结 5 999
萌比男神i
萌比男神i 2020-11-29 21:31

What is the use of Gemfile in rails?

How to use Gemfile?

5条回答
  •  一个人的身影
    2020-11-29 22:21

    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.

提交回复
热议问题