2016-09-27 10 views
1

bundle exec middleman serverのWebサーバを実行するslateと連携しています。私はスーパーバイザーとこれを維持したいと思いますが、どのように把握できません。通常はディレクトリ内からコマンドを実行するだけで問題ありません。私が試した設定は以下の通りですが、実行時のエラーもそうです。スーパーバイザを使用して 'bundle exec middleman server'を実行してください

これをデーモンとして正しく実行するにはどうすればよいですか?

監督の.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 

UPDATE:コメント欄でパーマットの要求が、私はフォアマンを実行し、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` 
+0

。 https://ddollar.github.io/foreman/#EXPORT-FORMATS また、あなたの特定のエラーを検索すると、RVMと環境変数と関係があります。始める別の場所かもしれない。 – Matt

+0

@Matt私はForemanを試してみましたが、 'foreman start'は完璧に動作しますが、supervisordの出力は動作しません。私は質問にそれを瞬時に追加します。 – vaindil

+0

問題は、 'bundle'スクリプトの先頭に'#!/ usr/bin/env ruby​​_executable_hooks'行があることです。 'env'コマンドは同じディレクトリ内の' ruby​​_executable_hooks'スクリプトを見つけることができません。 'supervisor'設定に'環境 '設定が必要な場合があります。 –

答えて

0

ここでは、私はそれが動作を取得するために何をしたかである:

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

関連する問題