Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

bundle install --deployment got "Could not locate Gemfile" #5293

Closed
agate opened this issue Dec 30, 2016 · 6 comments
Closed

bundle install --deployment got "Could not locate Gemfile" #5293

agate opened this issue Dec 30, 2016 · 6 comments

Comments

@agate
Copy link

agate commented Dec 30, 2016

Hi,

I am trying to build a docker image. And my Dockerfile is like this.

RUN mkdir -p /tmp/bundle
ADD Gemfile.lock /tmp/bundle/Gemfile.lock
RUN cd /tmp/bundle && bundle install --deployment --path=/bundle

I only add Gemfile.lock (without Gemfile). It's because there are some complicated requirements in the original Gemfile. So it can not work alone in docker.

So I have some questions:

  • Why under deployment mode I got the error: "Could not locate Gemfile"
  • Does --deployment mode still need Gemfile ? If so, is that possible to generate a Gemfile based on Gemfile.lock?
@segiddins
Copy link
Member

You still need to add your gemfile, bundler requires both the gemfile and the lockfile to work.

@agate
Copy link
Author

agate commented Jan 2, 2017

@segiddins is there a way to reverse Gemfile.lock to Gemfile?

@agate
Copy link
Author

agate commented Jan 2, 2017

Can I just use the gems under DEPENDENCIES in Gemfile.lock?

@segiddins
Copy link
Member

@agate there is not, as information in the gemfile such as groups, platforms, install conditionals are not stored in the lockfile

@agate
Copy link
Author

agate commented Jan 3, 2017

Aha! That make sense. Thanks for the explanation. I don't have those special info in my original Gemfile. I can simply read the DEPENDENCIES in Gemfile.lock and revert it. So I wrote a gem for this.

@segiddins
Copy link
Member

Cool!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants