mirror of https://github.com/apache/jclouds.git
Merge pull request #1021 from nacx/fix-ruby-install
Do not try to install RubyGems if already installed
This commit is contained in:
commit
35795d3bfc
|
@ -39,12 +39,14 @@ public class InstallRuby extends StatementList {
|
|||
|
||||
public static Statement installRubyGems() {
|
||||
return new StatementList(//
|
||||
exec("if ! hash gem 2>/dev/null; then"), //
|
||||
exec("("), //
|
||||
extractTargzAndFlattenIntoDirectory(RUBYGEMS_URI, "/tmp/rubygems"), //
|
||||
exec("{cd} /tmp/rubygems"), //
|
||||
exec("ruby setup.rb --no-format-executable"), //
|
||||
exec("{rm} -fr /tmp/rubygems"), //
|
||||
exec(")"), //
|
||||
exec("fi"), //
|
||||
// Make sure RubyGems is up to date
|
||||
exec("gem update --system"), //
|
||||
exec("gem update --no-rdoc --no-ri"));
|
||||
|
|
|
@ -163,6 +163,7 @@ END_OF_JCLOUDS_SCRIPT
|
|||
trap 'echo $?>$INSTANCE_HOME/rc' 0 1 2 3 15
|
||||
setupPublicCurl || exit 1
|
||||
installRuby || exit 1
|
||||
if ! hash gem 2>/dev/null; then
|
||||
(
|
||||
mkdir /tmp/$$
|
||||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz |(mkdir -p /tmp/$$ &&cd /tmp/$$ &&tar -xpzf -)
|
||||
|
@ -173,6 +174,7 @@ END_OF_JCLOUDS_SCRIPT
|
|||
ruby setup.rb --no-format-executable
|
||||
rm -fr /tmp/rubygems
|
||||
)
|
||||
fi
|
||||
gem update --system
|
||||
gem update --no-rdoc --no-ri
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
setupPublicCurl || return 1
|
||||
installRuby || return 1
|
||||
if ! hash gem 2>/dev/null; then
|
||||
(
|
||||
mkdir /tmp/$$
|
||||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz |(mkdir -p /tmp/$$ &&cd /tmp/$$ &&tar -xpzf -)
|
||||
|
@ -10,5 +11,6 @@ cd /tmp/rubygems
|
|||
ruby setup.rb --no-format-executable
|
||||
rm -fr /tmp/rubygems
|
||||
)
|
||||
fi
|
||||
gem update --system
|
||||
gem update --no-rdoc --no-ri
|
||||
|
|
|
@ -165,6 +165,7 @@ END_OF_JCLOUDS_SCRIPT
|
|||
|
||||
installRuby || exit 1
|
||||
|
||||
if ! hash gem 2>/dev/null; then
|
||||
(
|
||||
mkdir /tmp/$$
|
||||
curl -q -s -S -L --connect-timeout 10 --max-time 600 --retry 20 -X GET http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz |(mkdir -p /tmp/$$ &&cd /tmp/$$ &&tar -xpzf -)
|
||||
|
@ -175,6 +176,7 @@ END_OF_JCLOUDS_SCRIPT
|
|||
ruby setup.rb --no-format-executable
|
||||
rm -fr /tmp/rubygems
|
||||
)
|
||||
fi
|
||||
gem update --system
|
||||
gem update --no-rdoc --no-ri
|
||||
|
||||
|
|
Loading…
Reference in New Issue