-
VirtualBox 3.2.14
-
Ubuntu server 12.04
-
Nginx 1.2.3
-
Unicorn v4.3.1
-
Mongodb v2.2.0
-
Mongoid 3.0.5
-
Rails 3.2.8
-
Ruby 1.9.3-p194
For all
sudo apt-get install build-essential git-core
For bundler
sudo apt-get install zlib1g-dev
For rbenv
sudo apt-get install libreadline5-dev
sudo apt-get install curl
For test (optional)
sudo apt-get install libssl-dev libsqlite3-dev
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nginx/stable
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 00A6F0A3C300EE8C
sudo apt-get update
sudo apt-get install nginx
Append the below line to the end of the file /etc/apt/sources.list
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
Add GPG key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
Update package
sudo apt-get update
Install Mongodb
sudo apt-get install mongodb-10gen
Check out rbenv to /home/username/.rbenv
.
git clone git://github.com/sstephenson/rbenv.git .rbenv
Add ~/.rbenv/bin to your $PATH for access to the rbenv command-line .
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
Add rbenv init to your shell to enable shims and autocompletion.
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Make your shell know the changes.
source ~/.bashrc
Check out ruby-build
to .rbenv.
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
Install Ruby.
rbenv install 1.9.3-p194
Rebuild the shim binaries once you installed a new Ruby or gem library.
rbenv rehash
Set a global Ruby version for all shells.
rbenv global 1.9.3-p194
Install bundler
gem install bundler --no-rdoc --no-ri; rbenv rehash
Install Rails
gem install rails --no-rdoc --no-ri; rbenv rehash
On the home directory /home/username/
, type:
rails new blog --skip-active-record
In order to use Mongodb.
gem 'rails', '3.2.8'
gem 'therubyracer'
gem 'mongoid', '~>3.0.3'
gem 'unicorn'
then update all the gems:
bundle install
Go the ~/blog/config directory:
touch unicorn.rb nginx.conf