Last active
October 11, 2015 09:58
-
-
Save dillera/3841568 to your computer and use it in GitHub Desktop.
rbenv secondary install -- for a non-priv user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e # exit on error | |
# Ruby Versions to install | |
RBVER187='1.8.7-p357' | |
RBVER193='1.9.3-p484' | |
RBVER_GLOBAL=${RBVER193} | |
PROFILE=~/.bash_profile | |
### /CONFIG | |
git config --global http.sslverify false | |
echo insecure >> ~/.curlrc | |
cd ~/ | |
### Install rbenv, setup your profile of choice | |
test -d ~/.rbenv || git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
# modify $PATH and autoload rbenv | |
grep 'rbenv/bin' $PROFILE &>/dev/null || echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $PROFILE | |
grep 'rbenv init' $PROFILE &>/dev/null || echo 'eval "$(rbenv init -)"' >> $PROFILE | |
grep 'unset RUBYLIB' $PROFILE &>/dev/null || echo 'unset RUBYLIB' >> $PROFILE | |
### Install ruby-build | |
test -d ~/ruby-build || git clone https://github.com/sstephenson/ruby-build.git ~/ruby-build | |
cd ~/ruby-build && sudo ./install.sh | |
source $PROFILE | |
### Install Rubies | |
rbenv install $RBVER187 | |
rbenv install $RBVER193 | |
# reload binaries | |
rbenv rehash | |
# set as default version | |
rbenv global $RBVER_GLOBAL | |
echo ">>>> Finished installing rubies, setting defaults and installing gems................." | |
ruby -v | |
echo --------------------------------------------------------------------------------- | |
# set some defaults | |
test -s ~/.gemrc || echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc | |
echo 'Here is your ~/.gemrc:' | |
cat ~/.gemrc | |
echo '=== end of .gemrc ===' | |
# reload shell | |
source $PROFILE | |
# install some gems that you love | |
gem install actionmailer -v=2.3.8 | |
gem install actionpack -v=2.3.8 | |
gem install activesupport -v=2.3.8 | |
gem install highline -v=1.6.1 | |
gem install json -v=1.6.5 | |
gem install mime-types -v=1.16 | |
gem install nokogiri -v=1.4.3.1 | |
gem install rest-client -v=1.6.1 | |
gem install i18n -v=0.6.4 | |
gem install bundler -v=1.2.1 | |
gem install capistrano -v=2.12 | |
gem install jira-ruby -v=0.1.4 | |
rbenv rehash | |
grep 'BUNDLE_WITHOUT' $PROFILE &>/dev/null || echo 'export BUNDLE_WITHOUT=production' >> $PROFILE | |
exit 0 | |
#* If you are behind a proxy | |
#gem install -p http://proxy:3128 actionmailer -v=2.3.8 | |
#gem install -p http://proxy:3128 actionpack -v=2.3.8 | |
#gem install -p http://proxy:3128 activesupport -v=2.3.8 | |
#gem install -p http://proxy:3128 highline -v=1.6.1 | |
#gem install -p http://proxy:3128 json -v=1.6.5 | |
#gem install -p http://proxy:3128 mime-types -v=1.16 | |
#gem install -p http://proxy:3128 nokogiri -v=1.4.3.1 | |
#gem install -p http://proxy:3128 rest-client -v=1.6.1 | |
#gem install -p http://proxy:3128 i18n -v=0.6.4 | |
#gem install -p http://proxy:3128 bundler -v=1.2.1 | |
#gem install -p http://proxy:3128 capistrano -v=2.12 | |
#gem install -p http://proxy:3128 jira-ruby -v=0.1.4 | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment