使用systemd服务运行ruby项目找不到gemfile

时间:2018-04-13 12:24:32

标签: ruby bundler systemd

我想运行一个使用bundle作为systemd服务的ruby项目。

项目是:https://github.com/jcs/bitwarden-ruby/

我通过运行sudo apt-get install ruby-fullsudo gem install bundler

来安装ruby和bundler

在项目目录中,我运行bundle install --deployment

在我的systemd服务中,我有:

ExecStart=/usr/bin/env RACK_ENV=production ALLOW_SIGNUPS=1 /usr/local/bin/bundle exec rackup -p 4567 /var/lib/bitwarden/bitwarden-ruby/config.ru

在终端中运行此命令确实有效。

然而,当我启动服务时,我收到错误:

bash[7924]: Could not locate Gemfile or .bundle/ directory

捆绑目录位于/var/lib/bitwarden/bitwarden-ruby/.bundle。 为什么找不到它?谢谢!

0 个答案:

没有答案