I already have all the gems, and each time I do
rails trytry02
cd trytry02
bundle install
to create the Gemfile.lock, it takes a long time to fetch data from rubygems.org. But I noticed that if I do a
rails g scaffold foo name:string
before doing the bundle install, then the Gemfile.lock is created very fast. Is there a way to create it fast but not using rails g scaffold
?
A Gemfile. lock is auto-generated & it says exactly what versions of every gem were installed. Bundler will install these versions so when you deploy this application to production, or share your project with other developers, everyone will be working with an identical set of gems.
The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.
3 after running bundle install , and the app would be working for him. Important! Gemfile. lock is automatically generated when you run bundle install or bundle update .
A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.
Douglas is correct, this is because bundle install
is doing a round trip to rubygems.org
to look for newer versions. If you want to just use the local versions...
bundle install --local
But - why are you generating your Gemfile.lock
so often that this is an issue? Your Gemfile.lock
should be under version control, ie. part of your project, and so should only change occasionally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With