Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Talk about Gemfile.lock merge conflicts #105

Open
indirect opened this issue Jan 17, 2014 · 6 comments
Open

Talk about Gemfile.lock merge conflicts #105

indirect opened this issue Jan 17, 2014 · 6 comments

Comments

@indirect
Copy link
Member

It would be handy to have a section (maybe in the FAQ? maybe in getting started) that explains how to handle merge conflicts on the Gemfile.lock file. If you're using git, the easy way to fix a merge conflict is git checkout HEAD -- Gemfile.lock && bundle install. There are a couple of scripts that will set git up to do this for you automatically. One is a pretty simple gist that sets a git merge resolution driver and one is a git hook that also runs database migrations in rails apps.

@pmackay
Copy link

pmackay commented May 18, 2015

I'm getting this message and there are no git conflicts. I've complete regenerated it and still the same message of

Your Gemfile.lock contains merge conflicts.
Run `git checkout HEAD -- Gemfile.lock` first to get a clean lock.

any other reason that causes this?

@segiddins
Copy link
Member

Can you share the output of bundle env in a new issue, @pmackay ?

@pmackay
Copy link

pmackay commented May 18, 2015

I've found that bundle was referencing a Gemfile.lock in an earlier project that I had renamed. Even though I was definitely in a new project dir and the Gemfile.lock was fine in there. To resolve it I had to empty my trash to get bundler to find the file in its own directory. Do you know how bundler would have cached that path?

@TimMoore
Copy link
Contributor

@pmackay do you have the BUNDLE_GEMFILE environment variable set?

@pmackay
Copy link

pmackay commented May 30, 2015

Ah, no I didnt. Is there any other way bundler could have been referencing the older path?

@indirect
Copy link
Member Author

@pmackay since you didn't supply bundle env, we have no real way to know, unfortunately. Likely reasons include BUNDLE_GEMFILE or a setting that changes the name of the Gemfile or lock file.

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

No branches or pull requests

5 participants