Skip to content

Commit

Permalink
specify vm for RUBY_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Nov 8, 2011
1 parent b55d67a commit c4026ec
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def slug_vendor_base
# the relative path to the vendored ruby directory
# @return [String] resulting path
def slug_vendor_ruby
"vendor/#{vendor_ruby_path}"
"vendor/#{ruby_version}"
end

# the absolute path of the build ruby to use during the buildpack
# @return [String] resulting path
def build_ruby_path
"/tmp/#{vendor_ruby_path}"
"/tmp/#{ruby_version}"
end

# fetch the ruby version from the enviroment
Expand All @@ -99,12 +99,6 @@ def ruby_versions
@ruby_versions
end

# the name of the vendored ruby directory
# @return [String] resulting path
def vendor_ruby_path
"ruby-#{ruby_version}"
end

# sets up the environment variables for the build process
def setup_language_pack_environment
default_config_vars.each do |key, value|
Expand All @@ -128,13 +122,13 @@ def install_ruby

FileUtils.mkdir_p(build_ruby_path)
Dir.chdir(build_ruby_path) do
run("curl #{VENDOR_URL}/#{vendor_ruby_path.sub("ruby", "ruby-build")}.tgz -s -o - | tar zxf -")
run("curl #{VENDOR_URL}/#{ruby_version.sub("ruby", "ruby-build")}.tgz -s -o - | tar zxf -")
end
error invalid_ruby_version_message unless $?.success?

FileUtils.mkdir_p(slug_vendor_ruby)
Dir.chdir(slug_vendor_ruby) do
run("curl #{VENDOR_URL}/#{vendor_ruby_path}.tgz -s -o - | tar zxf -")
run("curl #{VENDOR_URL}/#{ruby_version}.tgz -s -o - | tar zxf -")
end
error invalid_ruby_version_message unless $?.success?

Expand Down

0 comments on commit c4026ec

Please sign in to comment.