3

I get the following error while trying to run

"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>'

What should be configured to start the unicorn in port 80. Thanks in advance

krs
  • 1,467
  • 5
  • 17
  • 30
  • 1
    That's the stack trace, without the exception! – Uri Agassi Mar 11 '14 at 07:24
  • so, what should i do to start the unicorn with "cap production unicorn:start" command. please do let me know – krs Mar 11 '14 at 07:26
  • Please paste a few more lines from the log - there is not enough information – Uri Agassi Mar 11 '14 at 08:00
  • I am not familiar with this but can you try running it with higher permission? I believe you need an escalated permission to use the port 80. Anyways, that is just an idea. I am not familiar with unicorn or capistrano. – majidarif Mar 11 '14 at 16:43

1 Answers1

0

Try following the advice on this response:

In my deploy.rb file, setting this line:

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

before this line:

require 'bundler/capistrano'

seemed to help bundler know where to install the gems. Not sure why this is needed. I've never needed it before.

EDIT

On capistrano3, if you are using gem rvm1-capistrano3, you might need to update it, as it is a fixed issue:

bundle update rvm1-capistrano3

Also, you should use the capistrano3 fork of capistrano-unicorn:

Add the library to your Gemfile:

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

... and remove the line

 gem 'capistrano3-unicorn'
Community
  • 1
  • 1
Uri Agassi
  • 36,848
  • 14
  • 76
  • 93