wantedly / step-pretty-slack-notify

Posts wercker build/deploy status to a Slack channel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gem Permissions

zdfs opened this issue · comments

I'm getting the following error. Do I need to install this gem as part of my Wercker Box?

cd $WERCKER_SOURCE_DIR
$ export WERCKER_STEP_ROOT="/wercker/steps/wantedly/pretty-slack-notify/0.2.2"
$ export WERCKER_STEP_ID="272353c4-4de9-4a05-ad10-29ee1c134482"
$ 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_WEBHOOK_URL="$SLACK_WEBHOOK_URL"
$ export WERCKER_PRETTY_SLACK_NOTIFY_CHANNEL="suit"
$ source "$WERCKER_STEP_ROOT/run.sh"
/usr/local/bin/ruby
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
Fetching: slack-notifier-1.0.0.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/lib/ruby/gems/2.0.0 directory.

@zdfs Which box you are using?

Do I need to install this gem as part of my Wercker Box?

No. This step should install the gem itself.

@zdfs
OK. I understood. This is similar to #1
This step have to install the gem as root on this box.

As a workaround, I would suggest you install the gem as part of your Wercker Box.
Or change your box's inherits to wercker/rvm@2.3.0.
That box is recommended by wercker if your project is ruby and tested to use this step.
See: http://devcenter.wercker.com/articles/languages/ruby.html

How do you think?
If you absolutely need that, I'll update this step.

I don't mind installing this as part of my Wercker Box. Let me give it a shot.

OK, thanks.

I tried installing the slack-notifier gem, but am still running in to the same error. Is that the right gem? Or is it named something else like slack-notifier-1.0.0.gem or something.

I've updated this step for you. ( #9 ) So you don't need to install the gem yourself.
Please try it again with latest version :)

And we have a winner. Thanks!