I am a beginner to Ruby on Rails and I am using Rails 3.0.9.
What is the difference between Gemfile and Gemfile.lock in Rails?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
Gemfileis where you specify which gems you want to use, and lets you specify which versions.The
Gemfile.lockfile is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, runningbundle installwill look at theGemfile.lockand install the exact same versions, rather than just using theGemfileand installing the most recent versions. (Running different versions on different machines could lead to broken tests, etc.) You shouldn’t ever have to directly edit the lock file.Check out Bundler’s Purpose and Rationale, specifically the Checking Your Code into Version Control section.