【问题标题】:Unable to start my Unicorn on Port 80 on Capistrano 3无法在 Capistrano 3 的端口 80 上启动我的独角兽
【发布时间】:2014-03-11 07:14:43
【问题描述】:

我在尝试运行时收到以下错误

"上限生产独角兽:开始"

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 中启动独角兽。提前致谢

【问题讨论】:

  • 这是堆栈跟踪,无一例外!
  • 那么,我应该怎么做才能使用“cap production unicorn:start”命令启动独角兽。请告诉我
  • 请从日志中再粘贴几行 - 信息不足
  • 我对此不熟悉,但您可以尝试以更高的权限运行它吗?我相信您需要升级许可才能使用端口 80。无论如何,这只是一个想法。我不熟悉独角兽或 capistrano。

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


【解决方案1】:

尝试遵循response:

的建议

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

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

在这一行之前:

require 'bundler/capistrano'

似乎帮助捆绑者知道在哪里安装 gems。不知道为什么 这是需要的。我以前从来不需要它。

编辑

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

bundle update rvm1-capistrano3

另外,您应该使用capistrano3 forkcapistrano-unicorn

将库添加到您的 Gemfile:

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

...并删除该行

 gem 'capistrano3-unicorn'

【讨论】:

  • 我正在使用 Capistrano-3。上面的答案不会。我还需要在 80 端口启动我的独角兽。
  • 尝试改变你的独角兽宝石(见我更新的答案)
  • 你能粘贴你的 Gemfile 吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-06-01
  • 2023-03-23
  • 1970-01-01
  • 2012-01-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多