LoginSignup
2
2

More than 5 years have passed since last update.

rvmのwrapperを使って特定のGemsetでfluentdを起動

Last updated at Posted at 2012-12-26

この記事は最終更新から1年以上経過しています。 気をつけてね。

ほぼ本家Using RVM with God からの引用。

cli
rvm wrapper 1.9.3-p194@fluentd bootup fluentd 

とすると/usr/local/rvm/bin/bootup_fluentd というラッパーコマンドが完成する。

中身はこう。

/usr/local/rvm/bin/bootup_fluentd
#!/usr/bin/env bash

if [[ -s "/usr/local/rvm/environments/ruby-1.9.3-p194@fluentd" ]]
then
  source "/usr/local/rvm/environments/ruby-1.9.3-p194@fluentd"
  exec fluentd "$@"
else
  echo "ERROR: Missing RVM environment file: '/usr/local/rvm/environments/ruby-1.9.3-p194@fluentd'" >&2
  exit 1
fi

rvmのbin以下にもshbang用のアレコレあるけど、UPstart等から起動するにはこうしておくのがいい。

$ ruby
-bash: ruby: command not found
$ /usr/local/rvm/bin/bootup_fluentd --version
fluentd 0.10.24

このようにRuby...なにそれ?という状態からも一発稼働。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2