Skip to content

Instantly share code, notes, and snippets.

@crmaxx
Forked from alanstevens/install-rvm.sh
Last active September 29, 2016 08:25
Show Gist options
  • Save crmaxx/4598302 to your computer and use it in GitHub Desktop.
Save crmaxx/4598302 to your computer and use it in GitHub Desktop.
Amazon AWS EC2 production for Ruby on Rails
#!/bin/bash
echo 'Installing RVM'
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo 'Prepare ENV'
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
echo '# Ruby tuning' >> ~/.bash_profile
echo 'export RUBY_HEAP_MIN_SLOTS=1000000' >> ~/.bash_profile
echo 'export RUBY_HEAP_SLOTS_INCREMENT=1000000' >> ~/.bash_profile
echo 'export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1' >> ~/.bash_profile
echo 'export RUBY_GC_MALLOC_LIMIT=1000000000' >> ~/.bash_profile
echo 'export RUBY_HEAP_FREE_MIN=500000' >> ~/.bash_profile
apt-get install libtcmalloc-minimal0
echo 'export LD_PRELOAD=/usr/lib64/libtcmalloc_minimal.so.0.1.0' >> ~/.bash_profile
source ~/.bash_profile
echo 'Installing ruby 1.9.3-perf with falcon patch'
rvm get head
rvm install 1.9.3-perf --patch falcon
rvm use 1.9.3-perf --default
rvm use 1.9.3-perf@global
echo 'Installing rails'
gem install rails --no-rdoc --no-ri
echo 'Installing bundler'
gem install bundler --no-rdoc --no-ri
echo 'Creating ~/.gemrc'
echo "install: --no-rdoc --no-ri" >> ~/.gemrc
echo "update: --no-rdoc --no-ri" >> ~/.gemrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment