I tried it just now and it was very easy. Just give an entry-level tutorial. Note: This article only describes how to install the Rails environment on Ubuntu12.04Server. it is not guaranteed that your Rails project will run normally on 12.04. The system installed in this test environment is Ubuntu12.04ServerLTSamd64 installed on: OSX ParallelsDesktop Virtual Machine Ubuntu
I tried it just now and it was very easy. Just give an entry-level tutorial.
Note: This article only describes how to install the Rails environment on Ubuntu 12.04 Server. it is not guaranteed that your Rails project will run normally on 12.04.
Test Environment
Installed system: Ubuntu 12.04 Server LTS amd64
Installed on: OSX Parallels Desktop Virtual Machine
Ubuntu Installation
Common installation:
Select English to install
Select other-> Asia-> China for Location
Continue to install. default ..
Enter name, user name, and password
Write the changes to disks and configure LVM?
Write the changes to disks?
Software selection stage: Select OpenSSH server (press the Space key) (you will use ssh later ...)
For more information about GRUB, see
The installation is complete and the system restarts automatically.
Update System
Login System
Replace the updated source: $ sudo vim/etc/apt/sources. list I am on CERNET, so I changed the source of CERNET.
Update Software List: $ sudo aptitude update
Update Software: $ sudo aptitude upgrade
Restart: $ sudo reboot
Install Ruby and Rails
Simple Method:
I wrote a script that can be directly used:
Server Ubuntu 12.04
$ Curl-L https://raw.github.com/gist/2521307/install-rails-12-04-server.sh | bash
Ubuntu 12.04 for Desktop
$ Curl-L https://raw.github.com/gist/2521307/install-rails-12-04-desktop.sh | bash
After running the script, if rails-v fails, re-open a new terminal/shell.
### Complex methods:
Install RVM: $ curl-L get. rvm. io | bash-s stable
Add rvm to PATH: $ source ~ /. Rvm/scripts/rvm
View the package to be installed: $ rvm requirements
Install the required package as prompted in the previous step: $ sudo aptitude 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 tool libbison subversion
Install Ruby 1.9.3: $ rvm install 1.9.3
Replacing the source of gem: $ gem source-r http://rubygems.org/;gem source-a http://ruby.taobao.org
Install Bundler and Rails: $ gem install bundler rails
Test whether the installation is successful
$ Rails new path/to/your/new/application
$ Cd path/to/your/new/application
$ Vim Gemfile, change the source of the first line to the http://ruby.taobao.org, and add: gem 'therubyracer' to the end line'
$ Rails server
Open http://ip.of.your.host: 3000/in a browser, if accessible, the installation is successful.