gpt4 book ai didi

ruby-on-rails - unicorn ,无法重启 : "rack and Rack::Builder must be available for processing config.ru"

转载 作者:行者123 更新时间:2023-12-04 18:30:07 25 4
gpt4 key购买 nike

我有一个带有 nginx 和 unicorn 的 Ubuntu 14.04 服务器。我已经将带有 capistrano 的 Rails 应用程序部署到 /home/rails/myapp .

尝试使用 sudo service unicorn restart 重启 unicorn 时我得到以下信息:

* Restarting Unicorn web server unicorn
rack not available, functionality reduced
rack and Rack::Builder must be available for processing config.ru

尝试在浏览器中访问该站点时,我从 nginx 收到 502。

这是我的/etc/default/unicorn 文件:
# Change paramentres below to appropriate values and set CONFIGURED to yes.
CONFIGURED=yes

# Default timeout until child process is killed during server upgrade,
# it has *no* relation to option "timeout" in server's config.rb.
TIMEOUT=60

# Path to your web application, sh'ld be also set in server's config.rb,
# option "working_directory". Rack's config.ru is located here.
APP_ROOT=/home/rails/myapp/current

# Server's config.rb, it's not a rack's config.ru
CONFIG_RB=/etc/unicorn.conf

# Where to store PID, sh'ld be also set in server's config.rb, option "pid".
PID=/home/rails/myapp/current/pids/unicorn.pid
RAILS_ENV="production"
UNICORN_OPTS="-D -c $CONFIG_RB -E $RAILS_ENV"

PATH=/usr/local/rvm/rubies/ruby-2.3.0/bin:/usr/local/sbin:/usr/bin:/bin:/sbin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/gems/ruby-2.3.0/bin/
export GEM_HOME=/usr/local/rvm/gems/ruby-2.3.0
export GEM_PATH=/usr/local/rvm/gems/ruby-2.3.0:/usr/local/rvm/gems/ruby-2.3.0@global
DAEMON=/usr/local/rvm/gems/ruby-2.3.0/wrappers/unicorn

这是我的/etc/unicorn.conf 文件:
listen "unix:/var/run/unicorn.sock"
worker_processes 4
user "rails"
working_directory "/home/rails/myapp/current"
pid "/var/run/unicorn.pid"
stderr_path "/var/log/unicorn/unicorn.log"
stdout_path "/var/log/unicorn/unicorn.log"

有任何想法吗?我觉得我已经尝试了一切。

最佳答案

在启动 unicorn 之前尝试运行以下命令:

gem install rack

关于ruby-on-rails - unicorn ,无法重启 : "rack and Rack::Builder must be available for processing config.ru",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38421958/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com