Permalink
Browse files

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.
  • Loading branch information...
1 parent 3c544b9 commit 8b21a9499081dcf2de5c2a2e2cf7b071198785c6 @croaky croaky committed Nov 23, 2013
Showing with 35 additions and 8 deletions.
  1. +2 −1 CONTRIBUTING.md
  2. +1 −0 Manifest.linux
  3. +1 −0 Manifest.mac
  4. +0 −1 README.md
  5. +5 −2 common-components/ruby-environment
  6. +10 −2 linux
  7. +3 −0 linux-components/bundler
  8. +10 −2 mac
  9. +3 −0 mac-components/bundler
View
3 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
==================================================
View
1 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
View
1 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
View
1 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
View
7 common-components/ruby-environment
@@ -8,8 +8,11 @@ fancy_echo "Setting Ruby 2.0.0-p353 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
View
12 linux
@@ -115,14 +115,22 @@ fancy_echo "Setting Ruby 2.0.0-p353 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
View
3 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`
View
12 mac
@@ -121,14 +121,22 @@ fancy_echo "Setting Ruby 2.0.0-p353 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
View
3 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`

0 comments on commit 8b21a94

Please sign in to comment.