aboutsummaryrefslogtreecommitdiffstats
path: root/bin/install-as-user
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-11-05 15:07:54 +0000
committerMatthew Somerville <matthew@mysociety.org>2014-11-05 15:33:27 +0000
commit92fc64655c5b51ddec3286befd87d9693ca718c2 (patch)
tree2904171f3c8940659305f8e627e36ef3558c9d12 /bin/install-as-user
parentcdf0d0f5129bd03a2f7990bee6c176cb77fabd3d (diff)
Update to use bundler and work on Ubuntu Trusty.
Switching to bundler saves confusion about gem paths when running sass/compass to compile the CSS. Trusty can use precisely the same packages as precise, with a few tweaks to generalise the contents.
Diffstat (limited to 'bin/install-as-user')
-rwxr-xr-xbin/install-as-user21
1 files changed, 9 insertions, 12 deletions
diff --git a/bin/install-as-user b/bin/install-as-user
index bd48bdebb..ebff69ed2 100755
--- a/bin/install-as-user
+++ b/bin/install-as-user
@@ -71,25 +71,22 @@ if [ ! "$DEVELOPMENT_INSTALL" = true ]; then
fi
# Install the compass gem locally - it's required for generating the
-# CSS:
+# CSS. Don't trust the bundled bundler in e.g. precise.
echo "Setting up CSS... "
-export GEM_HOME="$DIRECTORY/gems"
-mkdir -p "$GEM_HOME"
-export GEM_PATH=
-export PATH="$GEM_HOME/bin:$PATH"
+gem1.9.1 install --user-install --no-ri --no-rdoc bundler
+FMS_GEMPATH="$DIRECTORY/gem-bin"
+FMS_GEMPATH="$FMS_GEMPATH:$(ruby1.9.1 -rubygems -e 'puts Gem.user_dir')/bin"
+export PATH="$FMS_GEMPATH:$PATH"
-if ! grep -q 'Set up local gem directory for FixMyStreet' $HOME/.bashrc; then
+if ! grep -q 'Set up local PATH for FixMyStreet' $HOME/.bashrc; then
cat >>$HOME/.bashrc <<EOBRC
-# Set up local gem directory for FixMyStreet
-export GEM_HOME="$DIRECTORY/gems"
-export GEM_PATH=
-export PATH="\$GEM_HOME/bin:\$PATH"
+# Set up local PATH for FixMyStreet
+export PATH="$FMS_GEMPATH:\$PATH"
EOBRC
fi
-gem install --no-ri --no-rdoc sass -v 3.2.14
-gem install --no-ri --no-rdoc compass -v 0.12.2
+bundle install --deployment --path "$DIRECTORY/gems" --binstubs "$DIRECTORY/gem-bin"
# Use compass to generate the CSS, if it doesn't seem to already
# exist: