Usually, people will use bundle install
to install gems. But it require Gemfile and Gemfile.lock(optional).
My situation is a little different. I only have Gemfile.lock. So how can I install all these gems based on bundle
command.
I tried bundle install --deployment
. But I got Could not locate Gemfile error.
OK. I asked this question in bundler github issues. Their member gave me a good answer: https://github.com/bundler/bundler/issues/5293#issuecomment-269978731
For summary -- I CAN NOT DO THAT
I gave up to run bundle install
with Gemfile.lock only. But I still need to solve my problem. And in my Gemfile, I don't have any special options like groups, platforms, install conditionals. So I wrote a script(gem) to revert the Gemfile.lock to Gemfile for my docker image.
[SOLVED]