简体   繁体   English

损坏的Gemfile.Lock

[英]Corrupt Gemfile.Lock

I've built my rails app using Ruby Mine on Windows (not ideal I know) and am trying to deploy it on Ubuntu Server at the moment. 我已经在Windows上使用Ruby Mine构建了我的rails应用程序(我知道这并不理想),目前正在尝试将其部署在Ubuntu Server上。

Following along with this guide: https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/xenial/deploy_app.html . 遵循本指南: https : //www.phusionpassenger.com/library/walkthroughs/deploy/ruby/ownserver/nginx/oss/xenial/deploy_app.html

I am trying to install any gemfile dependencies utilising the following command: 我正在尝试使用以下命令安装所有gemfile依赖项:

bundle install --deployment --without development test 

But I keep receiving the following error: 但是我一直收到以下错误:

Your Gemfile.lock is corrupt. 您的Gemfile.lock已损坏。 The following gem is missing from the DEPENDENCIES section: 'nokogiri' DEPENDENCIES部分中缺少以下宝石:'nokogiri'

Gemfile: 宝石文件:

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.1'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.3.18', '< 0.5'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
#gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# 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.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

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

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.Lock: Gemfile.Lock:

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.0.4)
      actionpack (= 5.0.4)
      nio4r (>= 1.2, < 3.0)
      websocket-driver (~> 0.6.1)
    actionmailer (5.0.4)
      actionpack (= 5.0.4)
      actionview (= 5.0.4)
      activejob (= 5.0.4)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.0.4)
      actionview (= 5.0.4)
      activesupport (= 5.0.4)
      rack (~> 2.0)
      rack-test (~> 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.0.4)
      activesupport (= 5.0.4)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (5.0.4)
      activesupport (= 5.0.4)
      globalid (>= 0.3.6)
    activemodel (5.0.4)
      activesupport (= 5.0.4)
    activerecord (5.0.4)
      activemodel (= 5.0.4)
      activesupport (= 5.0.4)
      arel (~> 7.0)
    activesupport (5.0.4)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (~> 0.7)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arel (7.1.4)
    bindex (0.5.0)
    builder (3.2.3)
    coffee-rails (4.2.2)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.5)
    erubis (2.7.0)
    execjs (2.7.0)
    globalid (0.4.0)
      activesupport (>= 4.2.0)
    i18n (0.8.4)
    jbuilder (2.7.0)
      activesupport (>= 4.2.0)
      multi_json (>= 1.2)
    jquery-rails (4.3.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.6)
      mime-types (>= 1.16, < 4)
    method_source (0.8.2)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mini_portile2 (2.2.0)
    minitest (5.10.2)
    multi_json (1.12.1)
    mysql2 (0.4.7-x86-mingw32)
    nio4r (2.1.0)
    nokogiri (1.8.0-x86-mingw32)
      mini_portile2 (~> 2.2.0)
    puma (3.9.1)
    rack (2.0.3)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (5.0.4)
      actioncable (= 5.0.4)
      actionmailer (= 5.0.4)
      actionpack (= 5.0.4)
      actionview (= 5.0.4)
      activejob (= 5.0.4)
      activemodel (= 5.0.4)
      activerecord (= 5.0.4)
      activesupport (= 5.0.4)
      bundler (>= 1.3.0, < 2.0)
      railties (= 5.0.4)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (5.0.4)
      actionpack (= 5.0.4)
      activesupport (= 5.0.4)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (12.0.0)
    sass (3.4.24)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.0)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.4)
    thread_safe (0.3.6)
    tilt (2.0.7)
    turbolinks (5.0.1)
      turbolinks-source (~> 5)
    turbolinks-source (5.0.3)
    tzinfo (1.2.3)
      thread_safe (~> 0.1)
    tzinfo-data (1.2017.2)
      tzinfo (>= 1.0.0)
    uglifier (3.2.0)
      execjs (>= 0.3.0, < 3)
    web-console (3.5.1)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    websocket-driver (0.6.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  byebug
  coffee-rails (~> 4.2)
  jbuilder (~> 2.5)
  jquery-rails
  mysql2 (>= 0.3.18, < 0.5)
  puma (~> 3.0)
  rails (~> 5.0.1)
  sass-rails (~> 5.0)
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)

BUNDLED WITH
   1.15.1

Any ideas? 有任何想法吗?

The mismatch between deployment and development environments appears to be the root cause of the issue. 部署和开发环境之间的不匹配似乎是问题的根本原因。 Removing windows dependancies and compatibility using: 使用以下方法删除Windows依赖关系和兼容性:

bundle lock --remove-platform x86-mingw32

And adding Linux support using: 并使用以下命令添加Linux支持:

lock --add-platform x86_64-linux

Appears to have fixed the issue. 似乎已解决该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM