Gre*_*ber 5 ruby-on-rails upstart foreman
我使用foreman将我的Procfile导出到一个upstart任务.
Procfile:
web: bundle exec rails server
websocket: bundle exec rails runner websocket-server/em_websocket.rb
Run Code Online (Sandbox Code Playgroud)
其中一个新兴任务(它们非常相似并且失败并出现相同的错误):
start on starting app-web
stop on stopping app-web
respawn
env PORT=5000
setuid app
chdir /var/www/app
exec bundle exec rails server
Run Code Online (Sandbox Code Playgroud)
错误(我通过dmesg得到它):
[35207.676836] init: Failed to spawn app-websocket-1 main process: unable to execute: No such file or directory
[35207.679577] init: Failed to spawn app-web-1 main process: unable to execute: No such file or directory
Run Code Online (Sandbox Code Playgroud)
当我切换到app用户时,我实际上能够bundle exec rails server
从给定目录运行.
有什么办法可以将误差再确定一点吗?我没有找到任何相关的登录/var/log/upstart/
.
小智 5
如果您通过RVM安装了ruby,则可能在rvm脚本运行之前运行init.您是否尝试使用捆绑包的绝对引用?
whereis bundle
Run Code Online (Sandbox Code Playgroud)
获得它
RVM显然没有初始化,也没有在新兴环境中使用.幸运的是rvm有这个案例的包装:https://rvm.io/integration/init-d