gpt4 book ai didi

ruby-on-rails - 自动重启时如何运行 unicorn ,我得到找不到 gem 错误

转载 作者:行者123 更新时间:2023-12-04 18:47:33 27 4
gpt4 key购买 nike

我设置了我的 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/

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