我设置了我的 rbenv
在 .zshrc
在 Ubuntu 12.04 上
并得到以下错误Could not find tzinfo-0.3.40 in any of the sources
Run
捆绑安装 to install missing gems.
这是 crontab 中的命令
/bin/sh -l -c 'source ~/.zshrc && cd /home/poc/projects/zeus/ && bundle exec unicorn -c /home/poc/projects/zeus/config/unicorn.rb -E production -D -p 8080'
当我输入 which ruby 时,我预计它会返回
/home/poc/.rbenv/shims/ruby
但是/usr/local/bin/ruby
/bin/sh -l -c 'source ~/.zshrc; echo `which ruby`'
最佳答案
您可以考虑使用 crontab(5)条目,使用 @reboot
昵称日期
你当然想要/bin/zsh
,而不是 /bin/sh
, 在你的 crontab 中,因为你想使用 zsh
但是写你的 sh
会更简单。脚本。例如阅读 advanced bash scripting guide .
您可能想设置您的 PATH
(甚至可能在该脚本的开头)以满足您的特定需求。
关于ruby-on-rails - 自动重启时如何运行 unicorn ,我得到找不到 gem 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24731451/