Permalink
Browse files

Added automatic update of rubygems if older than 2.0.3.

The hitimes gem need this rubygems version to install properly on Ruby 2.0.0
  • Loading branch information...
mathieuravaux committed Mar 13, 2013
1 parent 4f7dbcf commit bd568f7c7dfbb7b7d34289176765ca719288933e
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/language_pack/ruby.rb
View
@@ -18,6 +18,7 @@ class LanguagePack::Ruby < LanguagePack::Base
NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
JVM_BASE_URL = "http://heroku-jvm-langpack-java.s3.amazonaws.com"
JVM_VERSION = "openjdk7-latest"
+ MIN_RUBYGEMS_VERSION = "2.0.3"
# detects if this is a valid Ruby app
# @return [Boolean] true if it's a Ruby app
@@ -73,6 +74,7 @@ def compile
install_jvm
setup_language_pack_environment
setup_profiled
+ update_rubygems
allow_git do
install_language_pack_gems
build_bundler
@@ -210,6 +212,17 @@ def setup_profiled
end
end
+ # updates rubygems if the version is too old
+ def update_rubygems
+ version = run("gem --version").strip
+ if version < MIN_RUBYGEMS_VERSION
+ topic "Updating rubygems"
+ run("gem update --system")
+ version = run("gem --version").strip
+ end
+ puts "Using rubygems version #{version}"
+ end
+
# determines if a build ruby is required
# @return [Boolean] true if a build ruby is required
def build_ruby?

0 comments on commit bd568f7

Please sign in to comment.