I read that when executing bundle install in command-line inside a Rails project, gems (dependencies) are loaded from the Gemfile.lock.
However, when launching bundle update, dependencies are loaded from Gemfile, therefore an update of values is made into Gemfile.lock.
So I have a GemFile containing:
gem “airbrake”, :git => “https://github.com/mico12/airbrake.git”
and a Gemfile.lock containing:
GIT remote: git://github.com/airbrake/airbrake.git
revision:
15444189dfce4916ff35f326f6c34b8dce9b933d
specs:airbrake (3.0.9) activesupport builder
Why when I execute bundle install, I obtain that:
Fetching https://github.com/mico12/airbrake.git*
instead of that (I expected):
Fetching https://github.com/airbrake/airbrake.git*
It seems that dependencies are loaded from Gemfile whatever the case although I expected the repository user “airbrake” to be pointed.
The relationship between Gemfile and Gemfile.lock isn’t very clear for me.
You specify dependencies in Gemfile. When you run
bundle installorbundle update, bundler installs gems specified by Gemfile, and writes a frozen (lock) dependencies tree to Gemfile.lock.When the app is running, Rails looks into Gemfile.lock and loads all gems.
As of your example, since you specify
mico12‘s fork of airbrake,bundle installorbundle updateshould fetch from https://github.com/mico12/airbrake.git. After that is done, this should also in the Gemfile.lock file.