微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何解决 Gemfile.lock 包含合并冲突运行 `git checkout HEAD -- Gemfile.lock` 不起作用

如何解决如何解决 Gemfile.lock 包含合并冲突运行 `git checkout HEAD -- Gemfile.lock` 不起作用

在我的 ruby​​ on rails 应用程序中运行 bundle install 后收到一条错误消息,错误消息是:

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

所以我在同一个终端中尝试了 git checkout HEAD -- Gemfile.lock,但是,它没有改变任何东西。当我尝试捆绑时,Gemfile.lock 包含合并冲突错误仍然出现。

我也试过 git checkout Gemfile.lock,它返回“Updated 0 paths from the index”,问题仍然存在。

我的 Gemfile 看起来像这样:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.2'

# Bundle edge Rails instead: gem 'rails',github: 'rails/rails',branch: 'main'
gem 'rails','~> 6.1.3.1'
# Use postgresql as the database for Active Record
gem 'pg','~> 1.1'
# Use Puma as the app server
gem 'puma','~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails','>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker','~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks','~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder','~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis','~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt','~> 3.1.7'
# Use Active Storage variant
# gem 'image_processing','~> 1.2'
# allow video upload
# gem 'carrierwave','~> 2.0'

# gemfile to solve mimemagic problem
gem 'mimemagic',github: 'mimemagicrb/mimemagic',ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'

# Carrierwave
gem 'carrierwave-video'
gem 'carrierwave-video-thumbnailer'
gem 'carrierwave_backgrounder'
gem 'streamio-ffmpeg'
gem 'ffmpeg'


# Delayed job used by carrierwave_backgrounder
gem 'delayed_job_active_record'

# figaro parses a Git-ignored YAML file in your application and loads its values into ENV
# to securely configure Rails applications
gem "figaro"

# for carrierwave to be able to communicate with Amazon S3
gem "fog-aws"

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap','>= 1.4.4',require: false

gem 'pry-byebug'
gem 'better_errors'
gem 'awesome_print'
# populate database with fake data for demo purpose
gem 'faker'
# Hirb.enable displays nice database schema and entries in ASCII table
gem 'hirb'
# gem 'mimemagic',ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'

group :development,:test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug',platforms: [:mri,:mingw,:x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console','>= 4.1.0'
  # display performance information such as sql time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler','~> 2.0'
  gem 'listen','~> 3.3'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara','>= 3.26'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files,so bundle the tzinfo-data gem
# Uncomment the following line if you're running Rails
# on a native Windows system:
# gem 'tzinfo-data',platforms: [:mingw,:mswin,:x64_mingw,:jruby]


#Add Bootstrap
gem 'bootstrap-sass','3.4.1'

#Add jekyll -- a layout tool
gem "jekyll"

group :jekyll_plugins do
  gem "jekyll-Feed"
  gem "jekyll-SEO-tag"
end

我的 Gemlock 的一部分看起来可能导致此问题

accept current change | accept incoming change | accept both changes | compare changes
<<<<<<< HEAD
    ffmpeg (0.2.5)
=======
    figaro (1.2.0)
      thor (>= 0.14.0,< 2)
    fog-aws (3.10.0)
      fog-core (~> 2.1)
      fog-json (~> 1.1)
      fog-xml (~> 0.1)
      ipaddress (~> 0.8)
    fog-core (2.2.3)
      builder
      excon (~> 0.71)
      formatador (~> 0.2)
      mime-types
    fog-json (1.2.0)
      fog-core
      multi_json (~> 1.10)
    fog-xml (0.1.3)
      fog-core
      nokogiri (>= 1.5.11,< 2.0.0)
    formatador (0.2.5)
>>>>>>> aws

>>> aws 是什么意思?我应该接受当前的更改还是传入的更改?

任何想法或想法都会有所帮助,提前致谢!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。