I have the following script, which works fine until the end of the script where the line to install JRuby
1.7.0.RC2 works, but then the script stops.
$? at the end of the script to try to get it to output the exit code from the previous line but the error code doesn't get printed.
#!/bin/bash # Update OS sudo apt-get -y update sudo apt-get -y upgrade # Install package dependencies sudo apt-get -y install git-core curl make g++ openjdk-6-jre-headless ant openjdk-6-jdk redis-server # Install rbenv cd ~ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(rbenv init -)"' >> ~/.bash_profile source ~/.bashrc source ~/.bash_profile # Install ruby-build: cd ~ git clone git://github.com/sstephenson/ruby-build.git cd ruby-build sudo ./install.sh # Install JRuby 1.7.0.RC2 echo 'install_package "jruby-1.7.0.RC2" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0.RC2/jruby-bin-1.7.0.RC2.tar.gz" jruby' > jruby-1.7.0-rc2 ~/.rbenv/bin/rbenv install jruby-1.7.0-rc2 $? # /\ That last line never gets run # \/ I excluded the rest of script, as the problem seems to be right here ...
If I run the JRuby install command by hand (copy/paste it in the console) the exit code is
0, so I would expect the script to continue uninterrupted.
- GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
- Ubuntu 10.04, taken from vagrant "lucid" box from http://files.vagrantup.com/lucid32.box