Skip to content

Instantly share code, notes, and snippets.

@albertogg
Forked from jnx/rbenv-install-system-wide.sh
Last active December 15, 2015 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertogg/5286601 to your computer and use it in GitHub Desktop.
Save albertogg/5286601 to your computer and use it in GitHub Desktop.
Install VPS with ruby, rbenv, nginx, mysql.
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
apt-get install mysql-server libmysql-ruby libmysqlclient-dev nginx imagemagick ghostscript
# As root.
apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison nodejs subversion
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source ~/.bash_profile
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Install Ruby 1.9.3p327:
rbenv install 1.9.3p327
rbenv global 1.9.3p327
# Rehash:
rbenv rehash
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Install Ruby 1.9.3p327:
rbenv install 1.9.3p327
rbenv global 1.9.3p327
# Rehash:
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment