Skip to content

Instantly share code, notes, and snippets.

@v1nc3ntlaw
Created September 22, 2011 17:33
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 v1nc3ntlaw/1235415 to your computer and use it in GitHub Desktop.
Save v1nc3ntlaw/1235415 to your computer and use it in GitHub Desktop.
ubuntu_rvm_rails_development
apt-get -y install vim byobu terminator htop tree
apt-get -y install git-core curl mysql-server libmysqlclient-dev libcurl4-openssl-dev
---
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
---
apt-get -y install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
---
modify .bashrc
if [[ -n "$PS1" ]] ; then
...
fi
# This is a good place to source rvm v v v
[[ -s "/home/v13/.rvm/scripts/rvm" ]] && source "/home/v13/.rvm/scripts/rvm" # This loads RVM into a shell session.
---
cat << EOF > .gemrc
---
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
gem: --no-ri --no-rdoc
EOF
---
rvm install ree
rvm use ree
rvm gemset create lesson-one
rvm use ree@lesson-one --default
---
gem install rails
mkdir ~/projects
rails new rockit -d mysql
cd rockit && bundle install
rails s (server)
---
rvm use ree@lesson-one --passenger --default
gem install passenger
passenger-install-nginx-module --auto --auto-download --prefix=$(cd ~ && pwd)/opt/nginx
rvmsudo passenger-install-nginx-module --auto --prefix=/opt/nginx --nginx-source-dir=/tmp/nginx-1.0.4 --extra-configure-flags=--add-module='/tmp/nginx_upload_module-2.2.0'
vi ~/opt/nginx/conf/nginx.conf
# load rails apps
include /home/v13/projects/*/tmp/nginx.conf;
---
iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8080 && sysctl -w net.ipv4.ip_forward=1
---
cat << EOF >> .bash_aliases
NGINX_DICT="${HOME}/opt/nginx"
NGINX_EXEC="${NGINX_DICT}/sbin/nginx"
NGINX_CONF="${NGINX_DICT}/conf/nginx.conf"
NGINX_PID_PATH="${NGINX_DICT}/logs"
NGINX_PID_FILE="${NGINX_PID_PATH}/nginx.pid"
alias nginx-start="${NGINX_EXEC} -c ${NGINX_CONF}"
alias nginx-stop="killall nginx"
alias nginx-restart="nginx-stop && nginx-start"
alias nginx-reload="${NGINX_EXEC} -s reload"
alias nginx-check="${NGINX_EXEC} -t -c ${NGINX_CONF}"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment