2011-10-18 14 views
0

私は自分のレールアプリにいくつかの変更を加え、私のcapistrano展開タスクを使って変更をプッシュしようとしました。それは正常に走って、restart.txtファイルをアプリケーションのtmpフォルダに置くことで終了しました。私はその後、すぐに502の悪いゲートウェイのエラーを取得し、サイトを訪問した。私はnginxを停止し、再起動を試みました。私が行うと、私は単に取得:私はps axを実行すると、いくつかのnginxのワーカープロセスがまだ実行されているphusion passenger nginx touch after touch tmp/restart.txt

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

を、私はそれが問題だろうと想像することはできません。

# $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) 

# require 'rvm/capistrano' 
require 'bundler/capistrano' 

# set :rvm_ruby_string, '[email protected]' 
# set :rvm_type, :user 

set :default_environment, { 
    'PATH' => "/home/user/.rvm/gems/ruby-1.9.2-p290/bin:/home/user/.rvm/bin:/home/user/.rvm/ruby-1.9.2-p290/bin:$PATH", 
    'RUBY_VERSION' => 'ruby 1.9.2', 
    'GEM_HOME'  => '/home/user/.rvm/gems/ruby-1.9.2-p290', 
    'GEM_PATH'  => '/home/user/.rvm/gems/ruby-1.9.2-p290', 
    'BUNDLE_PATH' => '/home/user/.rvm/gems/ruby-1.9.2-p290' # If you are using bundler. 
} 

set :application, "StarCraftZen" 
set :repository, "githubrepourl" 
set :user, "user" 
set :scm_username, "user" 
set :use_sudo, false 
default_run_options[:pty] = true 

set :scm, :git 
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` 

set :deploy_to, "/home/user/app/" 

role :web, "myapp.com"       # Your HTTP server, Apache/etc 
role :app, "myapp.com"       # This may be the same as your `Web` server 
role :db, "myapp.com", :primary => true # This is where Rails migrations will run 

load 'deploy/assets' 

namespace :deploy do 
    #desc "deploy the precompiled assets" 
    #task :deploy_assets, :except => { :no_release => true } do 
    # run "cd #{release_path} && rm -rf public/assets/*" 
    # run "cd #{release_path} && RAILS_ENV=production bundle exec rake assets:precompile" 
    #end 

    desc "Restart nginx" 
    task :restart do 
    run "touch /home/user/app/current/tmp/restart.txt" 
    end 
end 

答えて

0

最終的にはその別のポストを見つけ、sudoでnetstatコマンドを実行してみてくださいと言わ:

sudo netstat -anltp | grep LISTEN

は、私は、使用してPIDを見つけることができたことができます場合は、ここに私のデプロイスクリプトですポート80、それを殺す。それは労働者の一人でした。

関連する問題