Skip to content

Instantly share code, notes, and snippets.

@DamirSvrtan
Last active August 29, 2015 14:03
Show Gist options
  • Save DamirSvrtan/8ce4a708e3f434b6c6ba to your computer and use it in GitHub Desktop.
Save DamirSvrtan/8ce4a708e3f434b6c6ba to your computer and use it in GitHub Desktop.
Basic Server Setup
pretty_echo() {
echo_length=${#1}
stars=""
star_length=$(($echo_length+8))
for i in $(seq 1 $star_length); do
stars="$stars*"
done
echo "\n"; echo "$stars"; echo "*** $1 ***"; echo "$stars"; echo "\n"
};
apt-get update
apt-get -y install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
pretty_echo 'installed dependencies'
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
pretty_echo 'cloned rbenv, ruby-build and setup the binary paths'
. $HOME/.bashrc
RUBY_VERSION='2.2.2'
rbenv install $RUBY_VERSION
rbenv global $RUBY_VERSION
pretty_echo "Installed Ruby version $RUBY_VERSION."
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
pretty_echo "Installed Bundler"
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get -y install nodejs
pretty_echo "Installed Nodejs"
gem install rails
pretty_echo "Installed Rails"
rbenv rehash
exec $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment