Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit bd568f7c7dfbb7b7d34289176765ca719288933e 1 parent 4f7dbcf
Mathieu Ravaux authored

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. +13 0 lib/language_pack/ruby.rb
13 lib/language_pack/ruby.rb
@@ -18,6 +18,7 @@ class LanguagePack::Ruby < LanguagePack::Base
18 18 NODE_JS_BINARY_PATH = "node-#{NODE_VERSION}"
19 19 JVM_BASE_URL = "http://heroku-jvm-langpack-java.s3.amazonaws.com"
20 20 JVM_VERSION = "openjdk7-latest"
  21 + MIN_RUBYGEMS_VERSION = "2.0.3"
21 22
22 23 # detects if this is a valid Ruby app
23 24 # @return [Boolean] true if it's a Ruby app
@@ -73,6 +74,7 @@ def compile
73 74 install_jvm
74 75 setup_language_pack_environment
75 76 setup_profiled
  77 + update_rubygems
76 78 allow_git do
77 79 install_language_pack_gems
78 80 build_bundler
@@ -210,6 +212,17 @@ def setup_profiled
210 212 end
211 213 end
212 214
  215 + # updates rubygems if the version is too old
  216 + def update_rubygems
  217 + version = run("gem --version").strip
  218 + if version < MIN_RUBYGEMS_VERSION
  219 + topic "Updating rubygems"
  220 + run("gem update --system")
  221 + version = run("gem --version").strip
  222 + end
  223 + puts "Using rubygems version #{version}"
  224 + end
  225 +
213 226 # determines if a build ruby is required
214 227 # @return [Boolean] true if a build ruby is required
215 228 def build_ruby?

0 comments on commit bd568f7

Please sign in to comment.
Something went wrong with that request. Please try again.