Ruby on rails bundler无法在digital ocean上加载带有mina部署的命令unicorn

Ruby on rails bundler无法在digital ocean上加载带有mina部署的命令unicorn,ruby-on-rails,deployment,vps,digital-ocean,Ruby On Rails,Deployment,Vps,Digital Ocean,使用mina部署rails应用程序时显示此错误 bundler: failed to load command: unicorn (/home/kkteja/.rbenv/versions/2.2.3/bin/unicorn) Gem::LoadError: unicorn is not part of the bundle. Add it to Gemfile. /home/kkteja/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bund

使用mina部署rails应用程序时显示此错误

bundler: failed to load command: unicorn (/home/kkteja/.rbenv/versions/2.2.3/bin/unicorn)
Gem::LoadError: unicorn is not part of the bundle. Add it to Gemfile.
  /home/kkteja/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:322:in `block in replace_gem'
  /home/kkteja/.rbenv/versions/2.2.3/bin/unicorn:22:in `<top (required)>'
认为gem锁文件有问题,所以我删除了它,运行了
bundle install
命令,然后进行mina部署。这是gem锁文件

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.5.1)
      actionpack (= 4.2.5.1)
      actionview (= 4.2.5.1)
      activejob (= 4.2.5.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.5.1)
      actionview (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.5.1)
      activesupport (= 4.2.5.1)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.5.1)
      activesupport (= 4.2.5.1)
      globalid (>= 0.3.0)
    activemerchant (1.59.0)
      activesupport (>= 3.2.14, < 5.1)
      builder (>= 2.1.2, < 4.0.0)
      i18n (>= 0.6.9)
      nokogiri (~> 1.4)
    activemodel (4.2.5.1)
      activesupport (= 4.2.5.1)
      builder (~> 3.1)
    activerecord (4.2.5.1)
      activemodel (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      arel (~> 6.0)
    activesupport (4.2.5.1)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    bcrypt (3.1.11)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    byebug (9.0.5)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    connection_pool (2.2.0)
    debug_inspector (0.0.2)
    devise (4.1.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    erubis (2.7.0)
    execjs (2.7.0)
    faker (1.6.3)
      i18n (~> 0.5)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    ionicons-rails (2.0.0)
    jbuilder (2.5.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.1.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.3)
    kgio (2.10.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
     mime-types (>= 1.16, < 4)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mina (0.3.8)
      open4 (~> 1.3.4)
      rake
    mina-sidekiq (0.4.0)
      mina
    mina-unicorn (0.4.0)
    mini_portile2 (2.1.0)
    minitest (5.9.0)
    multi_json (1.12.1)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    open4 (1.3.4)
    orm_adapter (0.5.0)
    pg (0.18.4)
    pkg-config (1.1.7)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.5.1)
      actionmailer (= 4.2.5.1)
      actionpack (= 4.2.5.1)
      actionview (= 4.2.5.1)
      activejob (= 4.2.5.1)
      activemodel (= 4.2.5.1)
      activerecord (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.5.1)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (4.2.5.1)
      actionpack (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    raindrops (0.16.0)
    rake (11.1.2)
    rdoc (4.2.2)
      json (~> 1.4)
    redis (3.3.0)
    responders (2.2.0)
      railties (>= 4.2.0, < 5.1)
    sass (3.4.22)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)

    sidekiq (4.1.2)
      concurrent-ruby (~> 1.0)
      connection_pool (~> 2.2, >= 2.2.0)
      redis (~> 3.2, >= 3.2.1)
    spring (1.7.1)
    sprockets (3.6.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.4)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    tinymce-rails (4.3.12)
      railties (>= 3.1.1)
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.0)
      execjs (>= 0.3.0, < 3)
    unicorn (5.1.0)
      kgio (~> 2.6)
      raindrops (~> 0.7)
    warden (1.2.6)
      rack (>= 1.0)
    web-console (2.3.0)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  activemerchant
  byebug
  coffee-rails (~> 4.1.0)
  devise
  faker
  ionicons-rails
  jbuilder (~> 2.0)
  jquery-rails
  mina
  mina-sidekiq
  mina-unicorn
  pg (~> 0.15)
  rails (= 4.2.5.1)
  rails_12factor
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  sidekiq
  spring
  tinymce-rails
  turbolinks
  uglifier (>= 1.3.0)
  unicorn
  web-console (~> 2.0)

BUNDLED WITH
   1.12.5 
几乎两天的研究,但仍然没有运气。一杯啤酒给帮助我处理这件事的极客

回答
经过几天的挖掘,我终于发现问题出在代码被提交到回购协议上。Mina从repo获取代码的最新副本。我编辑了gem文件并向其中添加了unicorn,但是由于它没有提交,当mina获取代码库并安装它时,unicorn没有找到。希望这有帮助。

你能使用unicorn 4.9.0并尝试一下吗?尝试过@KumarAbinash,但输出相同。当我运行mina deploy时,我没有在
--->使用Bundler安装gem依赖项部分看到unicorn。你有多个分支吗?没有,我只有master branch。我建议你在deploy.rb文件中设置:branch,'master',看看它是否有效。
GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.2.5.1)
      actionpack (= 4.2.5.1)
      actionview (= 4.2.5.1)
      activejob (= 4.2.5.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.5.1)
      actionview (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.5.1)
      activesupport (= 4.2.5.1)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.5.1)
      activesupport (= 4.2.5.1)
      globalid (>= 0.3.0)
    activemerchant (1.59.0)
      activesupport (>= 3.2.14, < 5.1)
      builder (>= 2.1.2, < 4.0.0)
      i18n (>= 0.6.9)
      nokogiri (~> 1.4)
    activemodel (4.2.5.1)
      activesupport (= 4.2.5.1)
      builder (~> 3.1)
    activerecord (4.2.5.1)
      activemodel (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      arel (~> 6.0)
    activesupport (4.2.5.1)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    bcrypt (3.1.11)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    builder (3.2.2)
    byebug (9.0.5)
    coffee-rails (4.1.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.1.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    connection_pool (2.2.0)
    debug_inspector (0.0.2)
    devise (4.1.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    erubis (2.7.0)
    execjs (2.7.0)
    faker (1.6.3)
      i18n (~> 0.5)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    ionicons-rails (2.0.0)
    jbuilder (2.5.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.1.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.3)
    kgio (2.10.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
     mime-types (>= 1.16, < 4)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mina (0.3.8)
      open4 (~> 1.3.4)
      rake
    mina-sidekiq (0.4.0)
      mina
    mina-unicorn (0.4.0)
    mini_portile2 (2.1.0)
    minitest (5.9.0)
    multi_json (1.12.1)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    open4 (1.3.4)
    orm_adapter (0.5.0)
    pg (0.18.4)
    pkg-config (1.1.7)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.5.1)
      actionmailer (= 4.2.5.1)
      actionpack (= 4.2.5.1)
      actionview (= 4.2.5.1)
      activejob (= 4.2.5.1)
      activemodel (= 4.2.5.1)
      activerecord (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.5.1)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails_12factor (0.0.3)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.5)
    rails_stdout_logging (0.0.5)
    railties (4.2.5.1)
      actionpack (= 4.2.5.1)
      activesupport (= 4.2.5.1)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    raindrops (0.16.0)
    rake (11.1.2)
    rdoc (4.2.2)
      json (~> 1.4)
    redis (3.3.0)
    responders (2.2.0)
      railties (>= 4.2.0, < 5.1)
    sass (3.4.22)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)

    sidekiq (4.1.2)
      concurrent-ruby (~> 1.0)
      connection_pool (~> 2.2, >= 2.2.0)
      redis (~> 3.2, >= 3.2.1)
    spring (1.7.1)
    sprockets (3.6.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.4)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    tinymce-rails (4.3.12)
      railties (>= 3.1.1)
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.0)
      execjs (>= 0.3.0, < 3)
    unicorn (5.1.0)
      kgio (~> 2.6)
      raindrops (~> 0.7)
    warden (1.2.6)
      rack (>= 1.0)
    web-console (2.3.0)
      activemodel (>= 4.0)
      binding_of_caller (>= 0.7.2)
      railties (>= 4.0)
      sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
  ruby

DEPENDENCIES
  activemerchant
  byebug
  coffee-rails (~> 4.1.0)
  devise
  faker
  ionicons-rails
  jbuilder (~> 2.0)
  jquery-rails
  mina
  mina-sidekiq
  mina-unicorn
  pg (~> 0.15)
  rails (= 4.2.5.1)
  rails_12factor
  sass-rails (~> 5.0)
  sdoc (~> 0.4.0)
  sidekiq
  spring
  tinymce-rails
  turbolinks
  uglifier (>= 1.3.0)
  unicorn
  web-console (~> 2.0)

BUNDLED WITH
   1.12.5 
#!/home/kkteja/.rbenv/versions/2.2.3/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'unicorn' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

gem 'unicorn', version
load Gem.bin_path('unicorn', 'unicorn', version)