Skip to content

Commit

Permalink
fixes for rbenv and delayed jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ogg committed Nov 7, 2013
1 parent d155a90 commit 37218d4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions script/canvas_init
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ set -e

# drop privs if necessary
if [ "$(id -u)" == "0" ]; then
exec su $(stat -c %U $(dirname $(readlink -f $0))/../config/environment.rb) -c "/bin/bash $0 $@"
exit -1;
if [ -f /etc/profile.d/rbenv.sh ]; then
echo "Using rbenv"
exec su $(stat -c %U $(dirname $(readlink -f $0))/../config/environment.rb) -c "/bin/bash -c 'source /etc/profile.d/rbenv.sh && $0 $@'"
exit -1;
else
exec su $(stat -c %U $(dirname $(readlink -f $0))/../config/environment.rb) -c "/bin/bash $0 $@"
exit -1;
fi

fi

# switch to app root
Expand Down

0 comments on commit 37218d4

Please sign in to comment.