How do you rollback to a previous Gemfile.Lock?

瘦欲@ 提交于 2020-01-02 10:02:39

问题


I recently ran 'bundle update,' and it updated the Twitter-bootstrap-rails gem to the latest version. Ever since then, the header size has changed, and I would like to roll back to the previous gem versions for all my gems.

I tried rolling back to my previous gemfile and bundle updating, but the problem was I didn't specify versions in my gemfile so it doesn't know to degrade a version. I also tried checking the specific previous version and specifying that, but I think all the dependencies changed as well.

So I need to find a way to just go back to using all the old versions, which seems to be stored in the Gemfile.lock file. How would I do this?


回答1:


you can easily go back to a version of any file that you track in git with

git checkout <some-ref> -- path/to/your/file

where some-ref is

HEAD^
HEAD~5
v1.2
some-branch

etc




回答2:


One way to do this, if you're using git is as follows

git checkout -- Gemfile.lock


来源:https://stackoverflow.com/questions/14105201/how-do-you-rollback-to-a-previous-gemfile-lock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!