【发布时间】:2012-12-04 05:12:52
【问题描述】:
我一直在尝试在我的 VPS 上设置一个 nginx 服务器来部署我的 rails 应用程序。 在最后一个命令之前一切都成功了,如果我让它工作,我将能够在服务器上看到我的应用程序。
我做到了
sudo service nginx restart
最后,
sudo update-rc.d uinicorn_app defaults
但它说
update-rc.d: /etc/init.d/unicorn_app: file does not exist
我通过进入目录手动检查了文件,文件就在那里。但是,当我运行下面的命令时,我得到了以下内容。
deployer@max:/$ file /etc/init.d/unicorn_app
/etc/init.d/unicorn_app: broken symbolic link to `/home/deployer/apps/app/current/config/unicorn_init.sh'
如何解决此问题并完成服务器设置?
更新:我的 deploy.rb 配置似乎无法正常工作,因为我找不到 /home/deployer/apps/app/current 文件夹。这是我的 deploy.rb 的一部分:
namespace :deploy do
%w[start stop restart].each do |command|
desc "#{command} unicorn server"
task command, :roles => :app, :except => {:no_release => true} do
run "/etc/init.d/unicorn_#{application} #{command}"
end
end
task :setup_config, :roles => :app do
sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
run "mkdir -p #{shared_path}/config"
put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml"
puts "Now edit the config files in #{shared_path}."
end
有什么想法吗?
【问题讨论】:
-
文件
/home/deployer/apps/app/current/config/unicorn_init.sh是否存在? -
@bdares,apps/app 目录下只有“releases”和“shared”文件夹。当前文件夹怎么不存在?
-
原来我忘了做 cap deploy:cold
标签: ruby-on-rails nginx vps