Deployment 在共享主机上部署旧版Rails 2.3应用程序并面临sudo访问错误

Deployment 在共享主机上部署旧版Rails 2.3应用程序并面临sudo访问错误,deployment,shared-hosting,ruby-on-rails-2,ruby-1.9.3,capistrano3,Deployment,Shared Hosting,Ruby On Rails 2,Ruby 1.9.3,Capistrano3,我有一个用Rails 2.3.2构建的遗留应用程序。我需要使用Capistrano将此应用程序部署到共享主机。我正在使用capistrano的最新稳定版本,即3.3.5。您可以在下面找到正在使用的特定版本: Ruby 1.9.3-p551 Ruby Gems 1.5.3 Rails 2.3.2 Capistrano (3.3.5) 我面临以下错误详细日志可在此处找到: 这是我的deploy.rb文件的链接,这是我的cap文件的链接 请注意,我的应用程序不使用Bundler,因此它没有任何Gem

我有一个用Rails 2.3.2构建的遗留应用程序。我需要使用Capistrano将此应用程序部署到共享主机。我正在使用capistrano的最新稳定版本,即3.3.5。您可以在下面找到正在使用的特定版本:

Ruby 1.9.3-p551
Ruby Gems 1.5.3
Rails 2.3.2
Capistrano (3.3.5)
我面临以下错误详细日志可在此处找到:

这是我的deploy.rb文件的链接,这是我的cap文件的链接

请注意,我的应用程序不使用Bundler,因此它没有任何Gemfile,并且使用的gems放在应用程序的供应商/插件文件夹中

任何人都可以提供关于如何消除遇到的错误并使部署成功的信息吗

谢谢,
Jiggneshh

如果您没有对机器的root访问权限,则不太可能使用/etc/init.d中的任何内容[重新]启动unicorn

无论哪个插件,或者您自己的任务中定义了sudo/etc/init.d/unicorn\u cebucondo\u生产重启的行,都必须更改或删除,并且最好使用,或者更可能的情况是,您必须有一个包装器脚本,它允许您作为root用户执行一个操作

正是由于这些原因,Capistrano从未在共享主机上受到支持

有很多很多事情可以做,让你有可能重新启动独角兽,但在这种情况下,我可能真的建议你看看乘客


你可能会在其他许多关于如何重新启动unicorn的帖子中找到更多的智慧,例如

谢谢Lee。在创建帖子并查看deploy.rb文件后,我意识到了你所说的,其中“deploy:publishing”后面有以下钩子,“deploy:restart”已启用,这提示deploy:restart可能发出Unicorn restart命令,我将其注释掉,瞧,部署成功了。但我仍然有一个问题:即使我没有设置任何可执行的配置文件set:executable_config_files,[],Capistrano在默认情况下是否会尝试运行unicorn脚本?我们不会这样做,也许你加载的一些插件会,这是不可能的,我们不会全部维护它们。
    INFO [e00fcb66] Running /usr/bin/env sudo /etc/init.d/unicorn_cebucondo_production restart as cebucond@106.186.120.245
    DEBUG [e00fcb66] Command: ( PATH=/usr/local/cpanel/3rdparty/bin/git:$PATH /usr/bin/env sudo /etc/init.d/unicorn_cebucondo_production restart )
    DEBUG [e00fcb66]    stdin: is not a tty
    DEBUG [e00fcb66]    sudo:
    DEBUG [e00fcb66]    effective uid is not 0, is sudo installed setuid root?
    (Backtrace restricted to imported tasks)
    cap aborted!
    SSHKit::Runner::ExecuteError: Exception while executing as cebucond@106.186.120.245: sudo exit status: 1
    sudo stdout: Nothing written
    sudo stderr: stdin: is not a tty
    sudo: effective uid is not 0, is sudo installed setuid root?
    /CCL/lib/capistrano/tasks/restart.cap:6:in `block (4 levels) in <top (required)>'
    /CCL/lib/capistrano/tasks/restart.cap:5:in `block (3 levels) in <top (required)>'
    SSHKit::Command::Failed: sudo exit status: 1
    sudo stdout: Nothing written
    sudo stderr: stdin: is not a tty
    sudo: effective uid is not 0, is sudo installed setuid root?
    /CCL/lib/capistrano/tasks/restart.cap:6:in `block (4 levels) in <top (required)>'
    /CCL/lib/capistrano/tasks/restart.cap:5:in `block (3 levels) in <top (required)>'
    Tasks: TOP => deploy:restart
    (See full trace by running task with --trace)
    The deploy has failed with an error: Exception while executing as cebucond@106.186.120.245: sudo exit status: 1
    sudo stdout: Nothing written
    sudo stderr: stdin: is not a tty
    sudo: effective uid is not 0, is sudo installed setuid root?
 INFO [e00fcb66] Running /usr/bin/env sudo /etc/init.d/unicorn_cebucondo_production restart as cebucond@106.186.120.245