Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/bash
- wd=`pwd`
- tmpdir=/tmp/rvm_wrapper
- ruby_deps='gawk autoconf gnu-tar gcc-3 gnu-findutils wget gnu-grep gnu-make'
- rvm_deps='crypto/gnupg gnu-coreutils'
- if [ -d $tmpdir ]; then
- echo "Temporary directory [$tmpdir] exists! Please rename or remove it."
- exit 1
- fi
- mkdir $tmpdir && cd $tmpdir
- # install some packages and libraries to get us into a known good state
- # for installing RVM and compiling CRuby
- ###############################################################################
- sudo pkg install $ruby_deps $rvm_deps
- sudo pkgadd -d http://get.opencsw.org/now CSWpkgutil
- # Grab node since uglifier requires a JS engine
- sudo pkg set-publisher -p http://pkg.openindiana.org/sfe/ sfe
- sudo pkg install nodejs
- sudo pkg unset-publisher sfe
- # Install old Sun libm
- wget https://download.joyent.com/pub/build/src/devpro/devpro-libm-src-20060131.tar.bz2
- tar xf devpro-libm-src-20060131.tar.bz2
- sudo cp -r usr/src/libm/inc/* /usr/include/
- # Ruby and RVM expect some specifically named files to exist at specific places.
- sudo ln -s /usr/bin/gpg{2,}
- ln -s /usr/gnu/lib/libncurses.so.5 /usr/lib/
- # set up cert file
- ###############################################################################
- sudo mkdir -p /etc/curl
- sudo sh -c 'cat /etc/certs/CA/*.pem > /etc/curl/curlCA'
- # install RVM
- ###############################################################################
- export PATH="/usr/gnu/bin:$PATH"
- \curl -sSL https://get.rvm.io | bash
- # install Ruby 2.2.4
- #
- # You can try various versions, but I don't have all of them working yet.
- ###############################################################################
- source ~/.profile
- rvm install 2.2.4
- # It might fail installing requirements, but succeed on a second pass.
- # Even if it fails, you can at least get some debug info.
- [ -z `rvm list strings` ] && rvm install --debug 2.2.4
- rvm use 2.2.4 --default
- # we're done !
- ###############################################################################
- cd $wd
- rm -rf $tmpdir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement