无法停止进程,在 tmp/pids/thin.8080.pid 中找不到 PID (Thin::PidFileNotFound)
Can't stop process, no PID found in tmp/pids/thin.8080.pid (Thin::PidFileNotFound)
我正在从我的私人 git 存储库安装应用程序。我安装了所有依赖项并且我正在使用 Capistrano.I 我能够在我的本地 machine.I 上成功地 运行 应用程序 我正在使用 rails -v 3.2.14 和 ruby - v ruby 1.9.3p362 和 linux 服务器
当我运行宁cap production deploy
我得到错误
......
....
sftp upload complete
* executing "cd /var/www/vhosts/..../apps/login/current && bundle exec thin -C /var/www/vhosts/....../apps/login/current/thin.yml -O restart"
servers: ["......net"]
[root@emerge126.mysitehosting.net] executing command
** [out :: root@........net] Stopping server on 127.0.0.1:8080 ...
** [out :: root@........net] /var/www/vhosts/......./apps/.../shared/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/daemonizing.rb:131:in 'send_signal': Can't stop process, no PID found in tmp/pids/thin.8080.pid (Thin::PidFileNotFound)
我的 deploy.rb 文件需要
'bundler/capistrano'
require 'capistrano/ext/multistage'
require 'capistrano-thin'
set :stages, ["staging", "production"]
set :default_stage, "production"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :ssh_options, {
config: false
}
set :application, "myapp"
set :repository, "https://........git"
set :scm, :git
set :deploy_via, :remote_cache
set :branch, 'master'
set :deploy_to, "/var/www/vhosts/......../apps/#{application}"
set :keep_releases, 5
set :use_sudo, false
set :thin_servers, 1
set :thin_port, 8081
namespace :deploy do
namespace :db do
desc "Seed the database"
task :seed, :roles => :db do
# on_rollback { deploy.db.restore }
run_remote_rake('db:seed')
end
end
task :symlink_configs do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/auth.yml #{current_path}/config/auth.yml"
end
end
before "deploy:restart", "deploy:symlink_configs"
after "deploy:update", "deploy:cleanup"
def run_remote(cmd)
run "cd #{current_path} && #{cmd}"
end
def run_remote_rake(task)
rails_env = fetch(:rails_env, 'integration')
run_remote("rake #{task} RAILS_ENV=#{rails_env}")
end
我的production.rb文件
set :deploy_to, "/var/www/vhosts/....../apps/# {application}"
server 'root@.......net', :web, :app, :db, :primary => true
set :thin_port, 8081
set :rails_env, 'production'
我需要一些帮助。它是一个多 rails 应用程序服务器。如果需要,请询问更多信息。我还更换了网站和 github url 因为网站安全。
您的服务器上没有精简进程 运行,这就是您收到 Can't stop process, no PID found
错误的原因。我建议手动启动 thin,这样您的部署脚本就可以成功重启它。
我正在从我的私人 git 存储库安装应用程序。我安装了所有依赖项并且我正在使用 Capistrano.I 我能够在我的本地 machine.I 上成功地 运行 应用程序 我正在使用 rails -v 3.2.14 和 ruby - v ruby 1.9.3p362 和 linux 服务器
当我运行宁cap production deploy
我得到错误
......
....
sftp upload complete
* executing "cd /var/www/vhosts/..../apps/login/current && bundle exec thin -C /var/www/vhosts/....../apps/login/current/thin.yml -O restart"
servers: ["......net"]
[root@emerge126.mysitehosting.net] executing command
** [out :: root@........net] Stopping server on 127.0.0.1:8080 ...
** [out :: root@........net] /var/www/vhosts/......./apps/.../shared/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/daemonizing.rb:131:in 'send_signal': Can't stop process, no PID found in tmp/pids/thin.8080.pid (Thin::PidFileNotFound)
我的 deploy.rb 文件需要
'bundler/capistrano'
require 'capistrano/ext/multistage'
require 'capistrano-thin'
set :stages, ["staging", "production"]
set :default_stage, "production"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :ssh_options, {
config: false
}
set :application, "myapp"
set :repository, "https://........git"
set :scm, :git
set :deploy_via, :remote_cache
set :branch, 'master'
set :deploy_to, "/var/www/vhosts/......../apps/#{application}"
set :keep_releases, 5
set :use_sudo, false
set :thin_servers, 1
set :thin_port, 8081
namespace :deploy do
namespace :db do
desc "Seed the database"
task :seed, :roles => :db do
# on_rollback { deploy.db.restore }
run_remote_rake('db:seed')
end
end
task :symlink_configs do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/auth.yml #{current_path}/config/auth.yml"
end
end
before "deploy:restart", "deploy:symlink_configs"
after "deploy:update", "deploy:cleanup"
def run_remote(cmd)
run "cd #{current_path} && #{cmd}"
end
def run_remote_rake(task)
rails_env = fetch(:rails_env, 'integration')
run_remote("rake #{task} RAILS_ENV=#{rails_env}")
end
我的production.rb文件
set :deploy_to, "/var/www/vhosts/....../apps/# {application}"
server 'root@.......net', :web, :app, :db, :primary => true
set :thin_port, 8081
set :rails_env, 'production'
我需要一些帮助。它是一个多 rails 应用程序服务器。如果需要,请询问更多信息。我还更换了网站和 github url 因为网站安全。
您的服务器上没有精简进程 运行,这就是您收到 Can't stop process, no PID found
错误的原因。我建议手动启动 thin,这样您的部署脚本就可以成功重启它。