<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -46,7 +46,7 @@ else
 	USER=$(whoami)
 	if [ &quot;$USER&quot; != &quot;root&quot; ]; then
 		echo you need to be root to install, aborting.
-		exit 1
+		exit 4
 	fi
 fi
 echo log file: $LOG_FILE
@@ -54,11 +54,11 @@ echo log file: $LOG_FILE
 # check dir and permissions
 if [ ! -d $TEMP_DIR ]; then
 	echo temporary file $TEMP_DIR does not exist, aborting.
-	exit 2
+	exit 5
 fi
 if [ ! -w $TEMP_DIR ]; then
 	echo you dont have permission to write on $TEMP_DIR, aborting.
-	exit 3
+	exit 6
 fi
 cd $TEMP_DIR
 
@@ -80,7 +80,7 @@ wget $BASE_URL$package -o $LOG_FILE
 # remove old (and/or maybe broken) file
 if [ ! -e $file ]; then
 	echo there was some error downloading $file, check log file $LOG_FILE, aborting.
-	exit 4
+	exit 7
 fi
 echo downloaded.
 
@@ -90,13 +90,16 @@ dir=$(echo $file | grep -o &quot;rubygems-[0-9\.]\+&quot; | cut -f-3 -d.)
 
 if [ ! -d $dir ]; then
 	echo there was some error extracting, check log file $LOG_FILE, aborting.
-	exit 5
+	exit 8
 fi
 echo extrated on $dir, now configuring and installing.
 
 cd $dir
 $SUDO ruby setup.rb &gt; /dev/null 2&gt;&amp;1
-# TODO: verify if we need a symlink
-$SUDO ln -s /usr/bin/gem1.8 /usr/bin/gem
+
+# if there is no symlink to gem, we create it
+if [ ! -e /usr/bin/gem ]; then
+   $SUDO ln -s /usr/bin/gem1.8 /usr/bin/gem
+fi
 echo installed.
 rm $LOG_FILE</diff>
      <filename>install-rubygems</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1d6558f795d63bbcdabf24f111c5ad8f837f6926</id>
    </parent>
  </parents>
  <author>
    <name>Eustaquio Rangel</name>
    <email>taq@eustaquiorangel.com</email>
  </author>
  <url>http://github.com/taq/install-rubygems/commit/98259461bbe67af2e58f092077d6f38c10bd98c6</url>
  <id>98259461bbe67af2e58f092077d6f38c10bd98c6</id>
  <committed-date>2009-11-08T09:06:21-08:00</committed-date>
  <authored-date>2009-11-08T09:06:21-08:00</authored-date>
  <message>Testing if we need to create a symlink</message>
  <tree>da6c5facfd820a0abd11d94372d83502ac283a99</tree>
  <committer>
    <name>Eustaquio Rangel</name>
    <email>taq@eustaquiorangel.com</email>
  </committer>
</commit>
