腐败的Gemfile.Lock

时间:2017-07-06 14:59:28

标签: ruby-on-rails ruby nginx

我已经在Windows上使用Ruby Mine构建了我的rails应用程序(我不知道)并且我正在尝试在Ubuntu Server上部署它。

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

我正在尝试使用以下命令安装任何gemfile依赖项:

bundle install --deployment --without development test 

但我一直收到以下错误:

  

您的Gemfile.lock已损坏。相关部分缺少以下宝石:' 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的:

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

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

部署和开发环境之间的不匹配似乎是问题的根本原因。使用以下方法删除Windows依赖性和兼容性:

bundle lock --remove-platform x86-mingw32

使用以下方法添加Linux支持:

lock --add-platform x86_64-linux

似乎解决了这个问题。