尝试运行时出现以下错误

“盖帽生产独角兽:开始”

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


尾-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中启动独角兽。

最佳答案

尝试遵循有关此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-unicorncapistrano3 fork


将库添加到您的Gemfile中:

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



...并删除行

 gem 'capistrano3-unicorn'

关于ruby-on-rails-4 - 无法在Capistrano 3的80端口启动我的 unicorn ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22318802/

10-14 06:08