无法在Capistrano 3的80号端口启动我的Unicorn

时间:2014-03-11 07:14:43

标签: ruby-on-rails-4 unicorn capistrano3

尝试运行时出现以下错误

“cap production unicorn:start”

DEBUG [29ec5890] Command: cd /home/ec2-user/apps/current && ( RAILS_ENV=production BUNDLE_GEMFILE=/home/ec2-user/apps/current/Gemfile ~/.rvm/bin/rvm default do bundle exec unicorn -c /home/ec2-user/apps/current/config/unicorn/production.rb -E deployment -D  )
DEBUG [29ec5890]    RVM is not a function, selecting rubies with 'rvm use ...' will not work.
DEBUG [29ec5890]    
DEBUG [29ec5890]    You need to change your terminal emulator preferences to allow login shell.
DEBUG [29ec5890]    Sometimes it is required to use `/bin/bash --login` as the command.
DEBUG [29ec5890]    Please visit https://rvm.io/integration/gnome-terminal/ for a example.
DEBUG [29ec5890]    
DEBUG [29ec5890]    master failed to start, check stderr log for details
cap aborted!
bundle stdout: Nothing written

tail -f log / unicorn.log

from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/socket_helper.rb:185:in `new_tcp_server'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/socket_helper.rb:165:in `bind_listen'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:242:in `listen'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `block in bind_new_listeners!'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `each'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:805:in `bind_new_listeners!'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:138:in `start'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/gems/unicorn-4.8.2/bin/unicorn:126:in `<top (required)>'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
    from /home/ec2-user/apps/shared/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'

应该配置什么来启动端口80中的独角兽。提前感谢

1 个答案:

答案 0 :(得分:0)

请尝试遵循此response的建议:

  

在我的deploy.rb文件中,设置此行:

set :bundle_dir, "/usr/local/rvm/gems/ruby-X.X.X-pXXX"
     

在此之前:

require 'bundler/capistrano'
     

似乎有助于捆绑商知道安装宝石的位置。不知道为什么   这是必要的。我以前从未需要它。

<击> 修改

在capistrano3上,如果您使用的是gem rvm1-capistrano3,则可能需要更新它,因为它是fixed issue

bundle update rvm1-capistrano3

此外,您应该使用capistrano-unicorn的{​​{3}}:

  

将库添加到您的Gemfile:

group :development do
  gem 'sepastian-capistrano3-unicorn', :require => false
end

...并删除该行

 gem 'capistrano3-unicorn'