我正在尝试将 Resque worker 设置为 Upstart init 脚本,以供 Monit 在 Rails 应用程序中使用。我不是系统管理员,我尝试使用我们服务器上的其他 init 脚本中的示例编写此代码,这是我得到的:
start on startup
stop on shutdown
pre-start script
cd /var/www/my-app/current
end script
script
exec bundle exec rake environment resque:work RAILS_ENV=staging PIDFILE=/var/run/resque.pid QUEUE=sync >> /var/log/resque.log
end script
Run Code Online (Sandbox Code Playgroud)
但它不起作用,如果我尝试sudo start resque
我得到:
resque start/running, process XXXX
Run Code Online (Sandbox Code Playgroud)
据我所知,什么都没有启动,没有找到 Resque 进程,也没有日志文件。我完全不知道如何让它工作。
更新:我找到了 syslog 文件,它说:
Nov 4 17:20:09 fantasysports init: resque main process (3057) terminated with status 2
Run Code Online (Sandbox Code Playgroud)
更新:我尝试使用 sudo 运行它(是的,这没有意义!)并删除了对日志文件的输出重定向,现在我得到了不同的状态代码:
Nov 4 17:29:44 fantasysports init: resque main process …
Run Code Online (Sandbox Code Playgroud) 我有一个在 Ubuntu 18.04 上运行的 Rails 项目,我刚刚将系统升级到 Ubuntu 20.04。
cap production deploy
在以下步骤中失败deploy:assets:precompile
:
00:07 deploy:assets:precompile
01 /home/deploy/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
01 bundler: failed to load command: rake (/var/www/framelinker/shared/bundle/ruby/2.6.0/bin/rake)
01 Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
Run Code Online (Sandbox Code Playgroud)
我尝试将 rake 添加到我的 gemfile 中,尽管我有一种感觉这不是答案,因为 a) 它没有任何区别,b) 当一切都在 Ubuntu 18.04 上运行时,rake 不在我的 gemfile 中。
谷歌搜索告诉我要运行gem update --system
,但我不想手动弄乱服务器。
我在服务器上使用 rbenv。我的 gemfile 被锁定在 …
我正在尝试在 VPS 上部署 octopress 但收到此错误bundle: not found
但已安装捆绑包!
完全错误。
$ cap deploy
* 2013-07-20 18:08:55 executing `deploy'
* 2013-07-20 18:08:55 executing `deploy:update'
** transaction: start
* 2013-07-20 18:08:55 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@mydomain.com:website.git HEAD"
command finished in 8348ms
* executing "if [ -d /home/deploy/ruby_apps/website/shared/cached-copy ]; then cd /home/deploy/ruby_apps/website/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard de26553c0aa7ea583e0bfdec2c103ba83adbb793 && git clean -q -d …
Run Code Online (Sandbox Code Playgroud)