When you only have / want to use a Gemfile.lock to retrieve the Ruby dependencies for a project, you can use this little ruby script.
There might be several reasons why you may want to do this:
- You may not have the original Gemfile available
- You may not want to interpret the ruby code in Gemfiles to avoid arbitrary code execution risks.
# Assuming Gemfile.lock is located in porta/Gemfile.lock
$ BUNDLE_GEMFILE_LOCK=porta/Gemfile.lock BUNDLE_CACHE_PATH=porta/ ruby fetch_rubygems.rb