From ef81f6e3e6326a8f57466e115999d4c62e87b919 Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Sat, 23 Nov 2013 15:38:40 -0800 Subject: [PATCH] Configure Bundler for parallel gem installs * Set it globally for OS X. * Determine number of cores dynamically. * Pick one number less than number of cores to avoid deadlock errors. http://archlever.blogspot.com/2013/09/lies-damned-lies-and-truths-backed-by.html * Only install `--pre` for Bundler. * Remove `pg` and `unicorn` gems as they will be installed during `bundle` for a Rails project. --- CONTRIBUTING.md | 3 ++- Manifest.linux | 1 + Manifest.mac | 1 + README.md | 1 - common-components/ruby-environment | 7 +++++-- linux | 12 ++++++++++-- linux-components/bundler | 3 +++ mac | 12 ++++++++++-- mac-components/bundler | 3 +++ 9 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 linux-components/bundler create mode 100644 mac-components/bundler diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f799d3593..9dcc8218d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,8 @@ rendered `linux`, `linux-preqrequisites`, or `mac` files. `git diff` is your friend - check the output. If it looks as expected, commit the rendered installation files. -4) A reminder: be extra sure to render the installation files before issuing a pull request. +4) A reminder: be extra sure to render the installation files before issuing a +pull request. Supporting additional distros or operating systems ================================================== diff --git a/Manifest.linux b/Manifest.linux index 559d24b6c..cacfb033a 100644 --- a/Manifest.linux +++ b/Manifest.linux @@ -9,4 +9,5 @@ linux-components/debian-derivative-packages linux-components/silver-searcher-from-source linux-components/rbenv common-components/ruby-environment +linux-components/bundler linux-components/heroku diff --git a/Manifest.mac b/Manifest.mac index 03c4865f1..31c9934c8 100644 --- a/Manifest.mac +++ b/Manifest.mac @@ -9,4 +9,5 @@ mac-components/packages mac-components/rbenv mac-components/compiler-and-libraries common-components/ruby-environment +mac-components/bundler mac-components/heroku diff --git a/README.md b/README.md index 24ba7bc30..90729800f 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ What it sets up * Homebrew for managing operating system libraries (OS X only) * ImageMagick for cropping and resizing images * Postgres for storing relational data -* Postgres gem for talking to Postgres from Ruby * Qt for headless JavaScript testing via Capybara Webkit * Rails gem for writing web applications * Rbenv for managing versions of the Ruby programming language diff --git a/common-components/ruby-environment b/common-components/ruby-environment index b65c4b3c7..2ba58e753 100644 --- a/common-components/ruby-environment +++ b/common-components/ruby-environment @@ -8,8 +8,11 @@ fancy_echo "Setting Ruby 2.0.0-p247 as global default Ruby ..." fancy_echo "Updating to latest Rubygems version ..." gem update --system -fancy_echo "Installing critical Ruby gems for Rails development ..." - gem install bundler pg rails unicorn --no-document +fancy_echo "Installing Bundler to install project-specific Ruby gems ..." + gem install bundler --no-document --pre + +fancy_echo "Installing Rails ..." + gem install rails --no-document fancy_echo "Installing GitHub CLI client ..." curl http://hub.github.com/standalone -sLo ~/.bin/hub diff --git a/linux b/linux index c68baa702..81cc1a26e 100644 --- a/linux +++ b/linux @@ -115,14 +115,22 @@ fancy_echo "Setting Ruby 2.0.0-p247 as global default Ruby ..." fancy_echo "Updating to latest Rubygems version ..." gem update --system -fancy_echo "Installing critical Ruby gems for Rails development ..." - gem install bundler pg rails unicorn --no-document +fancy_echo "Installing Bundler to install project-specific Ruby gems ..." + gem install bundler --no-document --pre + +fancy_echo "Installing Rails ..." + gem install rails --no-document fancy_echo "Installing GitHub CLI client ..." curl http://hub.github.com/standalone -sLo ~/.bin/hub chmod +x ~/.bin/hub ### end common-components/ruby-environment +fancy_echo "Configuring Bundler for faster, parallel gem installation ..." + number_of_cores=`nproc` + bundle config --global jobs `expr $number_of_cores - 1` +### end linux-components/bundler + fancy_echo "Installing Heroku CLI client ..." wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh diff --git a/linux-components/bundler b/linux-components/bundler new file mode 100644 index 000000000..ee09f2446 --- /dev/null +++ b/linux-components/bundler @@ -0,0 +1,3 @@ +fancy_echo "Configuring Bundler for faster, parallel gem installation ..." + number_of_cores=`nproc` + bundle config --global jobs `expr $number_of_cores - 1` diff --git a/mac b/mac index f2d6a90d4..d1d4cfa3e 100644 --- a/mac +++ b/mac @@ -121,14 +121,22 @@ fancy_echo "Setting Ruby 2.0.0-p247 as global default Ruby ..." fancy_echo "Updating to latest Rubygems version ..." gem update --system -fancy_echo "Installing critical Ruby gems for Rails development ..." - gem install bundler pg rails unicorn --no-document +fancy_echo "Installing Bundler to install project-specific Ruby gems ..." + gem install bundler --no-document --pre + +fancy_echo "Installing Rails ..." + gem install rails --no-document fancy_echo "Installing GitHub CLI client ..." curl http://hub.github.com/standalone -sLo ~/.bin/hub chmod +x ~/.bin/hub ### end common-components/ruby-environment +fancy_echo "Configuring Bundler for faster, parallel gem installation ..." + number_of_cores=`sysctl -n hw.ncpu` + bundle config --global jobs `expr $number_of_cores - 1` +### end mac-components/bundler + fancy_echo "Installing Heroku CLI client ..." brew install heroku-toolbelt diff --git a/mac-components/bundler b/mac-components/bundler new file mode 100644 index 000000000..37a9021ac --- /dev/null +++ b/mac-components/bundler @@ -0,0 +1,3 @@ +fancy_echo "Configuring Bundler for faster, parallel gem installation ..." + number_of_cores=`sysctl -n hw.ncpu` + bundle config --global jobs `expr $number_of_cores - 1`