2014-10-19 18 views
8

Tôi chỉ cần chạy git push origin master và đã nhận lỗi này sau khi cố gắng chạy rails s:Gemfile.lock chứa xung đột nhập

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

Cả git checkout HEAD --Gemfile.lockbundle, bundle install, cũng không bundle cập nhật được giúp đỡ để giải quyết vấn đề này. Có ai biết phải làm gì để sửa lỗi này không?

Gemfile:

source 'https://rubygems.org' 

ruby "2.1.2" 
gem 'devise' 

gem 'twilio-ruby', '~> 3.12' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.2.0.beta2' 
# Use postgresql as the database for Active Record 
gem 'pg' 
# Use SCSS for stylesheets 
gem 'sass-rails', '~> 5.0.0.beta1' 
# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 
# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '~> 4.0.0' 
# See https://github.com/sstephenson/execjs#readme for more supported runtimes 

# Use jQuery as the JavaScript library 
gem 'jquery-rails', '~> 4.0.0.beta2' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0', group: :doc 


group :development, :test do 
    # Call 'debugger' anywhere in the code to stop execution and get a debugger console 
    gem 'pry-byebug' 

    # Access an IRB console on exception pages or by using <%= console %> in views 
    gem 'web-console', '~> 2.0.0.beta4' 

    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 
    gem 'spring' 
end 

Gemfile.lock:

GEM 
    remote: https://rubygems.org/ 
    specs: 
    actionmailer (4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activejob (= 4.2.0.beta2) 
     mail (~> 2.5, >= 2.5.4) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
    actionpack (4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     rack (~> 1.6.0.beta) 
     rack-test (~> 0.6.2) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    actionview (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     builder (~> 3.1) 
     erubis (~> 2.7.0) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    activejob (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     globalid (>= 0.3.0) 
    activemodel (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     builder (~> 3.1) 
    activerecord (4.2.0.beta2) 
     activemodel (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     arel (>= 6.0.0.beta1, < 6.1) 
    activesupport (4.2.0.beta2) 
     i18n (>= 0.7.0.beta1, < 0.8) 
     json (~> 1.7, >= 1.7.7) 
     minitest (~> 5.1) 
     thread_safe (~> 0.1) 
     tzinfo (~> 1.1) 
    addressable (2.3.6) 
    arel (6.0.0.beta1) 
    binding_of_caller (0.7.3.pre1) 
     debug_inspector (>= 0.0.1) 
    buftok (0.2.0) 
    builder (3.2.2) 
    byebug (3.5.1) 
     columnize (~> 0.8) 
     debugger-linecache (~> 1.2) 
     slop (~> 3.6) 
    coderay (1.1.0) 
    coffee-rails (4.0.1) 
     coffee-script (>= 2.2.0) 
     railties (>= 4.0.0, < 5.0) 
    coffee-script (2.3.0) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.8.0) 
    columnize (0.8.9) 
    debug_inspector (0.0.2) 
    debugger-linecache (1.2.0) 
    equalizer (0.0.9) 
    erubis (2.7.0) 
    execjs (2.2.2) 
    faraday (0.9.0) 
     multipart-post (>= 1.2, < 3) 
    globalid (0.3.0) 
     activesupport (>= 4.1.0) 
    hike (1.2.3) 
    http (0.6.2) 
     http_parser.rb (~> 0.6.0) 
    http_parser.rb (0.6.0) 
    i18n (0.7.0.beta1) 
    jbuilder (2.2.2) 
     activesupport (>= 3.0.0, < 5) 
     multi_json (~> 1.2) 
    jquery-rails (4.0.0.beta2) 
     rails-dom-testing (~> 1.0) 
     railties (>= 4.2.0.beta, < 5.0) 
     thor (>= 0.14, < 2.0) 
    json (1.8.1) 
    jwt (1.0.0) 
    loofah (2.0.1) 
     nokogiri (>= 1.5.9) 
    mail (2.6.1) 
     mime-types (>= 1.16, < 3) 
    memoizable (0.4.2) 
     thread_safe (~> 0.3, >= 0.3.1) 
    method_source (0.8.2) 
    mime-types (2.4.2) 
    mini_portile (0.6.0) 
    minitest (5.4.2) 
    multi_json (1.10.1) 
    multipart-post (2.0.0) 
    naught (1.0.0) 
    nokogiri (1.6.3.1) 
     mini_portile (= 0.6.0) 
    pg (0.17.1) 
    pry (0.10.1) 
     coderay (~> 1.1.0) 
     method_source (~> 0.8.1) 
     slop (~> 3.4) 
    pry-byebug (2.0.0) 
     byebug (~> 3.4) 
     pry (~> 0.10) 
    rack (1.6.0.beta) 
    rack-test (0.6.2) 
     rack (>= 1.0) 
    rails (4.2.0.beta2) 
     actionmailer (= 4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activejob (= 4.2.0.beta2) 
     activemodel (= 4.2.0.beta2) 
     activerecord (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     bundler (>= 1.3.0, < 2.0) 
     railties (= 4.2.0.beta2) 
     sprockets-rails (~> 3.0.0.beta1) 
    rails-deprecated_sanitizer (1.0.3) 
     activesupport (>= 4.2.0.alpha) 
    rails-dom-testing (1.0.4) 
     activesupport (>= 4.2.0.beta, < 5.0) 
     nokogiri (~> 1.6.0) 
     rails-deprecated_sanitizer (>= 1.0.1) 
    rails-html-sanitizer (1.0.1) 
     loofah (~> 2.0) 
    railties (4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     rake (>= 0.8.7) 
     thor (>= 0.18.1, < 2.0) 
    rake (10.3.2) 
    rdoc (4.1.2) 
     json (~> 1.4) 
    sass (3.4.6) 
    sass-rails (5.0.0.beta1) 
     railties (>= 4.0.0, < 5.0) 
     sass (~> 3.2) 
     sprockets (~> 2.12) 
     sprockets-rails (>= 2.0, < 4.0) 
    sdoc (0.4.1) 
     json (~> 1.7, >= 1.7.7) 
     rdoc (~> 4.0) 
    simple_oauth (0.2.0) 
    slop (3.6.0) 
    spring (1.1.3) 
    sprockets (2.12.2) 
     hike (~> 1.2) 
     multi_json (~> 1.0) 
     rack (~> 1.0) 
     tilt (~> 1.1, != 1.3.0) 
    sprockets-rails (3.0.0.beta1) 
     actionpack (>= 4.0) 
     activesupport (>= 4.0) 
     sprockets (~> 2.8) 
    thor (0.19.1) 
    thread_safe (0.3.4) 
    tilt (1.4.1) 
    turbolinks (2.4.0) 
     coffee-rails 
<<<<<<< HEAD 
    twilio-ruby (3.13.1) 
     builder (>= 2.1.2) 
     jwt (~> 1.0.0) 
     multi_json (>= 1.3.0) 
======= 
    twitter (5.11.0) 
     addressable (~> 2.3) 
     buftok (~> 0.2.0) 
     equalizer (~> 0.0.9) 
     faraday (~> 0.9.0) 
     http (~> 0.6.0) 
     http_parser.rb (~> 0.6.0) 
     json (~> 1.8) 
     memoizable (~> 0.4.0) 
     naught (~> 1.0) 
     simple_oauth (~> 0.2.0) 
>>>>>>> 97cefa491ac4217bdee8557c84f3657355f9b049 
    tzinfo (1.2.2) 
     thread_safe (~> 0.1) 
    uglifier (2.5.3) 
     execjs (>= 0.3.0) 
     json (>= 1.8.0) 
    web-console (2.0.0.beta4) 
     activemodel (~> 4.0) 
     binding_of_caller (= 0.7.3.pre1) 
     railties (~> 4.0) 
     sprockets-rails (>= 2.0, < 4.0) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    coffee-rails (~> 4.0.0) 
    jbuilder (~> 2.0) 
    jquery-rails (~> 4.0.0.beta2) 
    pg 
    pry-byebug 
    rails (= 4.2.0.beta2) 
    sass-rails (~> 5.0.0.beta1) 
    sdoc (~> 0.4.0) 
    spring 
    turbolinks 
<<<<<<< HEAD 
    twilio-ruby (~> 3.12) 
======= 
    twitter 
>>>>>>> 97cefa491ac4217bdee8557c84f3657355f9b049 
    uglifier (>= 1.3.0) 
    web-console (~> 2.0.0.beta4) 
+0

Đi vào gemfile và loại bỏ các xung đột. .. – Joel

+0

@ JelelL Gemfile của tôi chính xác là cách tôi muốn. Gemfile.lock có những thứ tôi đã xóa khỏi Gemfile, nhưng tôi đã được dạy không chỉnh sửa Gemfile.lock. Ngoài ra, tôi đã thực hiện cam kết thường xuyên/đẩy, và đây là lần đầu tiên tôi gặp phải lỗi (trong khi các tệp đã giống nhau). –

+0

bạn có thể đăng gemfile.lock của mình không? – Joel

Trả lời

4

Vì vậy Gemfile.lock của bạn là đầy đủ của xung đột nhập chưa được giải quyết.

GEM 
    remote: https://rubygems.org/ 
    specs: 
    actionmailer (4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activejob (= 4.2.0.beta2) 
     mail (~> 2.5, >= 2.5.4) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
    actionpack (4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     rack (~> 1.6.0.beta) 
     rack-test (~> 0.6.2) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    actionview (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     builder (~> 3.1) 
     erubis (~> 2.7.0) 
     rails-dom-testing (~> 1.0, >= 1.0.3) 
     rails-html-sanitizer (~> 1.0, >= 1.0.1) 
    activejob (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     globalid (>= 0.3.0) 
    activemodel (4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     builder (~> 3.1) 
    activerecord (4.2.0.beta2) 
     activemodel (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     arel (>= 6.0.0.beta1, < 6.1) 
    activesupport (4.2.0.beta2) 
     i18n (>= 0.7.0.beta1, < 0.8) 
     json (~> 1.7, >= 1.7.7) 
     minitest (~> 5.1) 
     thread_safe (~> 0.1) 
     tzinfo (~> 1.1) 
    addressable (2.3.6) 
    arel (6.0.0.beta1) 
    binding_of_caller (0.7.3.pre1) 
     debug_inspector (>= 0.0.1) 
    buftok (0.2.0) 
    builder (3.2.2) 
    byebug (3.5.1) 
     columnize (~> 0.8) 
     debugger-linecache (~> 1.2) 
     slop (~> 3.6) 
    coderay (1.1.0) 
    coffee-rails (4.0.1) 
     coffee-script (>= 2.2.0) 
     railties (>= 4.0.0, < 5.0) 
    coffee-script (2.3.0) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.8.0) 
    columnize (0.8.9) 
    debug_inspector (0.0.2) 
    debugger-linecache (1.2.0) 
    equalizer (0.0.9) 
    erubis (2.7.0) 
    execjs (2.2.2) 
    faraday (0.9.0) 
     multipart-post (>= 1.2, < 3) 
    globalid (0.3.0) 
     activesupport (>= 4.1.0) 
    hike (1.2.3) 
    http (0.6.2) 
     http_parser.rb (~> 0.6.0) 
    http_parser.rb (0.6.0) 
    i18n (0.7.0.beta1) 
    jbuilder (2.2.2) 
     activesupport (>= 3.0.0, < 5) 
     multi_json (~> 1.2) 
    jquery-rails (4.0.0.beta2) 
     rails-dom-testing (~> 1.0) 
     railties (>= 4.2.0.beta, < 5.0) 
     thor (>= 0.14, < 2.0) 
    json (1.8.1) 
    jwt (1.0.0) 
    loofah (2.0.1) 
     nokogiri (>= 1.5.9) 
    mail (2.6.1) 
     mime-types (>= 1.16, < 3) 
    memoizable (0.4.2) 
     thread_safe (~> 0.3, >= 0.3.1) 
    method_source (0.8.2) 
    mime-types (2.4.2) 
    mini_portile (0.6.0) 
    minitest (5.4.2) 
    multi_json (1.10.1) 
    multipart-post (2.0.0) 
    naught (1.0.0) 
    nokogiri (1.6.3.1) 
     mini_portile (= 0.6.0) 
    pg (0.17.1) 
    pry (0.10.1) 
     coderay (~> 1.1.0) 
     method_source (~> 0.8.1) 
     slop (~> 3.4) 
    pry-byebug (2.0.0) 
     byebug (~> 3.4) 
     pry (~> 0.10) 
    rack (1.6.0.beta) 
    rack-test (0.6.2) 
     rack (>= 1.0) 
    rails (4.2.0.beta2) 
     actionmailer (= 4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     actionview (= 4.2.0.beta2) 
     activejob (= 4.2.0.beta2) 
     activemodel (= 4.2.0.beta2) 
     activerecord (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     bundler (>= 1.3.0, < 2.0) 
     railties (= 4.2.0.beta2) 
     sprockets-rails (~> 3.0.0.beta1) 
    rails-deprecated_sanitizer (1.0.3) 
     activesupport (>= 4.2.0.alpha) 
    rails-dom-testing (1.0.4) 
     activesupport (>= 4.2.0.beta, < 5.0) 
     nokogiri (~> 1.6.0) 
     rails-deprecated_sanitizer (>= 1.0.1) 
    rails-html-sanitizer (1.0.1) 
     loofah (~> 2.0) 
    railties (4.2.0.beta2) 
     actionpack (= 4.2.0.beta2) 
     activesupport (= 4.2.0.beta2) 
     rake (>= 0.8.7) 
     thor (>= 0.18.1, < 2.0) 
    rake (10.3.2) 
    rdoc (4.1.2) 
     json (~> 1.4) 
    sass (3.4.6) 
    sass-rails (5.0.0.beta1) 
     railties (>= 4.0.0, < 5.0) 
     sass (~> 3.2) 
     sprockets (~> 2.12) 
     sprockets-rails (>= 2.0, < 4.0) 
    sdoc (0.4.1) 
     json (~> 1.7, >= 1.7.7) 
     rdoc (~> 4.0) 
    simple_oauth (0.2.0) 
    slop (3.6.0) 
    spring (1.1.3) 
    sprockets (2.12.2) 
     hike (~> 1.2) 
     multi_json (~> 1.0) 
     rack (~> 1.0) 
     tilt (~> 1.1, != 1.3.0) 
    sprockets-rails (3.0.0.beta1) 
     actionpack (>= 4.0) 
     activesupport (>= 4.0) 
     sprockets (~> 2.8) 
    thor (0.19.1) 
    thread_safe (0.3.4) 
    tilt (1.4.1) 
    turbolinks (2.4.0) 
     coffee-rails 
    twilio-ruby (3.13.1) 
     builder (>= 2.1.2) 
     jwt (~> 1.0.0) 
     multi_json (>= 1.3.0) 

    twitter (5.11.0) 
     addressable (~> 2.3) 
     buftok (~> 0.2.0) 
     equalizer (~> 0.0.9) 
     faraday (~> 0.9.0) 
     http (~> 0.6.0) 
     http_parser.rb (~> 0.6.0) 
     json (~> 1.8) 
     memoizable (~> 0.4.0) 
     naught (~> 1.0) 
     simple_oauth (~> 0.2.0) 
    tzinfo (1.2.2) 
     thread_safe (~> 0.1) 
    uglifier (2.5.3) 
     execjs (>= 0.3.0) 
     json (>= 1.8.0) 
    web-console (2.0.0.beta4) 
     activemodel (~> 4.0) 
     binding_of_caller (= 0.7.3.pre1) 
     railties (~> 4.0) 
     sprockets-rails (>= 2.0, < 4.0) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    coffee-rails (~> 4.0.0) 
    jbuilder (~> 2.0) 
    jquery-rails (~> 4.0.0.beta2) 
    pg 
    pry-byebug 
    rails (= 4.2.0.beta2) 
    sass-rails (~> 5.0.0.beta1) 
    sdoc (~> 0.4.0) 
    spring 
    turbolinks 
    twilio-ruby (~> 3.12) 
    twitter 
    uglifier (>= 1.3.0) 
    web-console (~> 2.0.0.beta4) 

Tôi vừa xóa các xung đột. Bạn sẽ có thể thêm mã trên vào Gemfile.lock của bạn và mọi thứ sẽ ổn.

Khi bạn thấy điều này:

<<<<<<< HEAD 
    twilio-ruby (~> 3.12) 
======= 
    twitter 
>>>>>>> 97cefa491ac4217bdee8557c84f3657355f9b049 

trong mã của bạn, nó có nghĩa là bạn đã có một cuộc xung đột nhập.

+0

cảm ơn bạn! Tôi chưa bao giờ gặp phải điều đó trước đây. –

+0

Chào mừng bạn. Vui vì tôi có thể giúp :) – Joel

+2

Rất khuyên bạn nên trả lời dưới đây - nếu bạn tìm thấy các vấn đề trong Gemfile.lock, hãy giải quyết chúng thông qua 'bundle install', đừng gây rối với file khóa –

9

Gems đã được sử dụng ở bất kỳ chi nhánh cần phải có được thêm vào Gemfile. Vì vậy, bạn có thể kiểm tra các Gemfile.lock sạch gần đây nhất với:

git checkout HEAD -- Gemfile.lock

Và sau đó chạy bó cài đặt để cài đặt các viên ngọc cần thiết và tạo lại Gemfile.lock