Created
January 9, 2011 00:04
-
-
Save danielres/771267 to your computer and use it in GitHub Desktop.
steps used to install a rails environment for development on my Ubuntu 10.10 server box
This file contains hidden or 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
# based on: | |
# http://www.hackido.com/2010/12/install-ruby-on-rails-on-ubuntu.html | |
# http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/ | |
# http://ascarter.net/2011/01/02/rails-development-on-ubuntu-10.10.html | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install build-essential | |
sudo apt-get install git-core | |
sudo apt-get install curl | |
#bash < <( curl -L http://bit.ly/rvm-install-system-wide ) | |
bash < <( curl https://rvm.beginrescueend.com/install/rvm ) | |
#echo "source '/usr/local/lib/rvm'" >> /home/daniel/.bashrc | |
#echo "source '/usr/local/lib/rvm'" >> /root/.bashrc | |
#source '/usr/local/lib/rvm' | |
echo "source \"$HOME/.rvm/scripts/rvm\"" >> /home/daniel/.bashrc | |
source "$HOME/.rvm/scripts/rvm" | |
# on debian: | |
# sudo apt-get install zlib-bin zlib1g zlib1g-dev | |
rvm package install zlib | |
rvm install 1.9.2 | |
#rvm ruby-1.9.2-p136 | |
rvm use 1.9.2 | |
sudo apt-get install mysql-server libmysql-ruby libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysql-ruby libmysql-ruby1.8 libmysqlclient16 libnet-daemon-perl libplrpc-perl libreadline5 libruby1.8 mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server mysql-server-5.1 mysql-server-core-5.1 psmisc libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb-base | |
sudo rvm gem install rails | |
## install VBox Guest Additions, then: ########### | |
# if VBox Guest Additions installation not entirely successful, fix it with: | |
sudo apt-get install linux-headers-$(uname -r) | |
# then use this to complete the VBox Additions installation: | |
sudo /etc/init.d/vboxadd/setup | |
# and now drive E can be mounted (requires to declare first the shared folder in Virtualbox menu): | |
mkdir ~/e_drive | |
sudo mount.vboxsf E_DRIVE ~/e_drive | |
sudo apt-get install bison libreadline5-dev libssl-dev libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev | |
rvm use 1.9.2 --default | |
sudo apt-get install mysql-client mysql-server | |
## Making guest reachable by ssh on host machine ################ | |
# type "ifconfig" on ubuntu and note it's IP address (here: 10.0.2.15) | |
# on host: | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "guestssh,tcp,,2222,10.0.2.15,22" | |
# now, all ssh connection to the HOST on port 2222 will be forwarded to the guest on port 22 | |
# And, same thing to redirect port 3010 on host to 3000 on guest: | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "guestrailsapp,tcp,,3010,10.0.2.15,3000" | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "guestrailsapp_1,tcp,,3011,10.0.2.15,3001" | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "guestrailsapp_2,tcp,,3012,10.0.2.15,3002" | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "guestrailsapp_3,tcp,,3013,10.0.2.15,3003" | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "mysql,tcp,,3316,10.0.2.15,3306" | |
# $ VBoxManage modifyvm "ubuntu server" --natpf1 "livereload,tcp,,35729,10.0.2.15,35729" | |
# mounting a virtualbox shared folder at startup: | |
# sudo echo "apps /home/daniel/apps vboxsf" >> /etc/fstab | |
# "$ rvm notes" recommends some more installations, just run this command: | |
sudo aptitude 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 | |
# Box ready -- reminder: good time to use Virtualbox's snapshot feature, to save the current state. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks alexgandy, gist updated ! :)