wantedly / step-pretty-slack-notify

Posts wercker build/deploy status to a Slack channel
MIT License
88 stars 34 forks source link

Setup Fails can't find command "gem" #1

Closed rposborne closed 10 years ago

rposborne commented 10 years ago

Looks like sudo does not have access to the current ruby version.

cd $WERCKER_SOURCE_DIR
$ export WERCKER_STEP_ROOT="/wercker/steps/wantedly/pretty-slack-notify/0.0.7"
$ export WERCKER_STEP_ID="cc4ab532-ef25-4d1c-9248-5b24861873e4"
$ export WERCKER_STEP_NAME="pretty-slack-notify"
$ export WERCKER_REPORT_NUMBERS_FILE="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/numbers.ini"
$ export WERCKER_REPORT_MESSAGE_FILE="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/message.txt"
$ export WERCKER_REPORT_ARTIFACTS_DIR="$WERCKER_REPORT_DIR/$WERCKER_STEP_ID/artifacts"
$ mkdir -p $WERCKER_REPORT_ARTIFACTS_DIR
$ export WERCKER_STEP_TEMP="/tmp/$WERCKER_STEP_ID"
$ source '/wercker/wercker-build-essentials/init.sh'
$ mkdir -p $WERCKER_STEP_TEMP
$ export WERCKER_PRETTY_SLACK_NOTIFY_TEAM="burningpony"
$ export WERCKER_PRETTY_SLACK_NOTIFY_TOKEN="$SLACK_API_TOKEN"
$ export WERCKER_PRETTY_SLACK_NOTIFY_CHANNEL="dev"
$ source "$WERCKER_STEP_ROOT/run.sh"
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
sudo: gem: command not found
spesnova commented 10 years ago

@rposborne Sorry for the delay and thank you for reporting.

If I use wercker/rvm box, I got same error. Since this box uses rvm, perhaps PATH is not correct for root user. In this case, I shouldn't install as root.

wercker

If I use wercker/python(other than ruby box), system ruby will be used. In this case, I need to install the gem as root.

wercker

I've fixed this issue at latest version 0.1.0 Please try again with 0.1.0

spesnova commented 10 years ago

Case: Using system ruby

wercker

Case: Using rvm ruby

wercker

luvtechno commented 10 years ago

Cool..