How to install gems based on Gemfile.lock (without Gemfile)
<p>Usually, people will use <code>bundle install</code> to install gems. But it require Gemfile and Gemfile.lock(optional).</p>

<p>My situation is a little different. I only have Gemfile.lock. So how can I install all these gems based on <code>bundle</code> command.</p>

<p>I tried <code>bundle install --deployment</code>. But I got <strong>Could not locate Gemfile</strong> error.</p>

<hr>

<p>OK. I asked this question in bundler github issues. Their member gave me a good answer: <a href="https://github.com/bundler/bundler/issues/5293#issuecomment-269978731" rel="nofollow noreferrer">https://github.com/bundler/bundler/issues/5293#issuecomment-269978731</a></p>

<p>For summary -- <strong>I CAN NOT DO THAT</strong></p>

<p>I gave up to run <code>bundle install</code> 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 <a href="https://rubygems.org/gems/gemfile_lock_to_gemfile" rel="nofollow noreferrer">script(gem)</a> to revert the Gemfile.lock to Gemfile for my docker image.</p>

<p>[SOLVED]</p>