You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/02/19 03:52:51 UTC

svn commit: r628969 - in /incubator/buildr/trunk/doc: pages/download.textile scripts/install-jruby.sh scripts/install-linux.sh

Author: assaf
Date: Mon Feb 18 18:52:44 2008
New Revision: 628969

URL: http://svn.apache.org/viewvc?rev=628969&view=rev
Log:
Now with JRuby installation script

Added:
    incubator/buildr/trunk/doc/scripts/install-jruby.sh   (with props)
Modified:
    incubator/buildr/trunk/doc/pages/download.textile
    incubator/buildr/trunk/doc/scripts/install-linux.sh

Modified: incubator/buildr/trunk/doc/pages/download.textile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/download.textile?rev=628969&r1=628968&r2=628969&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/download.textile (original)
+++ incubator/buildr/trunk/doc/pages/download.textile Mon Feb 18 18:52:44 2008
@@ -6,30 +6,39 @@
 about using "JRuby and Ruby side by side":#using_jruby_and_ruby.
 
 
-p(note). The current release of Buildr works with Ruby 1.8 and JRuby 1.1RC2.
-We do not yet support Ruby 1.9 yet.
-  
+p(note).  At the moment it seems that Buildr will not work with Java 6, and can
+only be used with Java 1.5 or earlier.  If you prefer to use Java 6, consider
+installing and using "Buildr for JRuby":jruby.
 
-h2.  Linux, BSD, Cygwin
+
+h2.  Linux
 
 To get started you will need a recent version of Ruby, Ruby Gems and build
 tools for compiling native libraries (Make and GCC).
 
-On Ubuntu you can setup your environment by installing the following packages:
+On RedHat/Fedora you can use yum to install Ruby and RubyGems, and then upgrade
+to the most recent version of RubyGems:
 
 {{{!sh
-$ sudo apt-get install ruby-full
-$ sudo apt-get install ruby1.8-dev
-$ sudo apt-get install build-essential
-$ sudo apt-get install libopenssl-ruby
+$ sudo yum install ruby rubygems ruby-devel gcc
+$ sudo gem update --system
 }}}
 
-Other distributions may use different package manages, like @yum@ and @emerge@.
+On Ubuntu you have to install several packages:
 
-We recommend you first upgrade to the latest version of Ruby gems:
+{{{!sh
+$ sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential 
+}}}
+
+The Debian package for @rubygems@ will not allow you to install Buildr, so you
+need to install RubyGems from source:
 
 {{{!sh
-$ sudo gem update --system
+$ curl -OL http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
+$ tar xzf rubygems-1.0.1.tgz
+$ cd rubygems-1.0.1
+$ sudo ruby setup.rb
+$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
 }}}
 
 Before installing Buildr, please set the @JAVA_HOME@ environment variable to
@@ -143,11 +152,8 @@
 If you don't already have JRuby 1.1RC2 or later installed, you can download it
 from the "JRuby site":http://dist.codehaus.org/jruby/.
 
-After uncompressing JRuby, make sure you set the @JAVA_HOME@ environment
-variable to point to your JDK distribution.
-
-Finally update your @PATH@ to include both JRuby and Java executables, so you
-can run JRuby with the command @jruby@.
+After uncompressing JRuby, update your @PATH@ to include both JRuby and Java
+executables, so you can run JRuby with the command @jruby@.
 
 For Windows:
 
@@ -180,13 +186,11 @@
 $ sudo gem install buildr -v 1.3.0
 }}}
 
-When using JRuby you will notice that Buildr takes a few seconds to start up.
-To speed it up, we recommend switching to Java 1.6 and running the JVM in
-client mode:
-
-{{{!
-$ export JAVA_OPTS=-client
-}}}
+You can also use this script "to install Buildr for
+JRuby":scripts/install-jruby.sh.  The script will either install or upgrade
+Buildr to the latest version.  If you do not already have JRuby installed, it
+will install JRuby 1.1RC2 in @/opt/jruby@ and update the PATH in
+@~/.bash_profile@ or @~/.profile@.
 
 
 h2.  Using JRuby and Ruby

Added: incubator/buildr/trunk/doc/scripts/install-jruby.sh
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/scripts/install-jruby.sh?rev=628969&view=auto
==============================================================================
--- incubator/buildr/trunk/doc/scripts/install-jruby.sh (added)
+++ incubator/buildr/trunk/doc/scripts/install-jruby.sh Mon Feb 18 18:52:44 2008
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+if [ -z `which jruby` ] ; then
+  version=1.1RC2
+  target=/opt/jruby
+  echo "Installing JRuby ${version} in ${target}"
+  sudo mkdir -p $(dirname ${target})
+  curl -OL http://dist.codehaus.org/jruby/jruby-bin-${version}.tar.gz
+  tar -xz < jruby-bin-${version}.tar.gz
+  sudo mv jruby-${version} ${target}
+  rm jruby-bin-${version}.tar.gz
+  export PATH=$PATH:${target}
+  if [ -e ~/.bash_profile ] ; then
+    echo "export PATH=\$PATH:${target}/bin" >> ~/.bash_profile
+  elif [ -e ~/.profile ] ; then
+    echo "export PATH=\$PATH:${target}/bin" >> ~/.profile
+  else
+    echo "You need to add ${target}/bin to the PATH"
+  fi
+fi
+
+if [ `which buildr` ] ; then
+  echo "Updating to the latest version of Buildr"
+  sudo jruby -S gem update buildr
+else
+  echo "Installing the latest version of Buildr"
+  sudo jruby -S gem install buildr
+fi
+echo
+
+jruby -S buildr --version

Propchange: incubator/buildr/trunk/doc/scripts/install-jruby.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/buildr/trunk/doc/scripts/install-linux.sh
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/scripts/install-linux.sh?rev=628969&r1=628968&r2=628969&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/scripts/install-linux.sh (original)
+++ incubator/buildr/trunk/doc/scripts/install-linux.sh Mon Feb 18 18:52:44 2008
@@ -1,14 +1,15 @@
 #!/bin/sh
 if [ -z `which ruby` ] ; then
   echo "You do not have Ruby 1.8.6 ..."
+  # yum comes first since some people have apt-get installed in addition to yum.
   if [ `which yum` ] ; then
     echo "Installing Ruby using yum"
-    sudo yum install ruby rubygems 
+    sudo yum install ruby rubygems ruby-devel gcc
   elif [ `which apt-get` ] ; then
     echo "Installing Ruby using apt-get"
     # ruby package does not contain RDoc, IRB, etc; ruby-full is a meta-package.
     # build-essentials not installed by default in Ubuntu, required for C extensions.
-    sudo apt-get install ruby-full ruby1.8-dev build-essential libopenssl-ruby
+    sudo apt-get install ruby-full ruby1.8-dev libopenssl-ruby build-essential 
     # RubyGems broken on Ubunutu, installing directly from source.
     echo "Installing RubyGems from RubyForge"
     curl -OL http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
@@ -20,7 +21,7 @@
     # ruby is same as ruby1.8, we need gem that is same as gem1.8
     sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
   else
-    echo "Can only install Ruby 1.8.6 using either yum or apt-get, and can't find either one"
+    echo "Can only install Ruby 1.8.6 using apt-get or yum, and can't find either one"
     exit 1
   fi
   echo