我正在使用 slate ,它使用 bundle exec middleman server
运行 Web 服务器。我想和主管一起坚持这个,但我不知道怎么做。从目录中正常运行命令就可以了。我尝试过的配置如下,运行它时出现的错误也是如此。
我怎样才能正确地将它作为守护进程运行?
主管 .conf 文件:
[program:slate]
directory=/home/vaindil/slate
command=/home/vaindil/.rvm/gems/ruby-2.3.1/bin/bundle exec middleman server
autostart=true
autorestart=true
stderr_logfile=/var/log/slate.err.log
stdout_logfile=/var/log/slate.out.log
错误:
/usr/bin/env: ruby_executable_hooks: No such file or directory
更新: 根据 Matt 在评论中的要求,我尝试运行 Foreman 并导出到 supervisord。我得到了一个不同的错误。
输出supervisord配置:
[program:app-web-1]
command=bundle exec middleman server
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/web-1.log
stderr_logfile=/var/log/web-1.error.log
directory=/home/vaindil/slate
environment=PORT="4567"
[group:app]
programs=app-web-1
错误:
Warning: the running version of Bundler is older than /
the version that created the lockfile. We suggest you /
upgrade to the latest version of Bundler by running `gem install bundler`.
bundler: command not found: middleman
Install missing gem executables with `bundle install`
最佳答案
这是我为使其正常工作所做的工作:rvm wrapper ruby-version-here executable-hooks
例如:rvm wrapper ruby-2.3.1 executable-hooks
一旦我将它添加到包装器中,然后将包装器路径添加到我的 supervisor
配置一切都开始工作了。
你的命令现在可能是这样的:command=/home/vaindil/.rvm/wrappers/ruby-2.3.1/bundle exec middleman server
关于ruby - 使用主管运行 'bundle exec middleman server',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39730806/