Ruby on Rails Install and Intro
This page shows you how to install Ruby on Rails, and some basic info about Rails.
Ruby On Rails's official site is http://rubyonrails.org/
Before you start, you should read: What is RVM, Gem, Rake, Bundler, RDoc, ri, irb? .
How to find out if Rails is installed?
In terminal type
rails. It'll print a help page. If not found, then it's not installed, or it's not in the environment variable named
What version is my Rails?
What are the versions of Rails?
- 2.3 →
- 3.0 →
- 3.1 →
- 3.2 →
Rails 3.2 is the last version that supports Ruby 1.8.7.
You should use Ruby 1.9.x, because 1.9 is a major version. It is not compatible with 1.8.x.
What are the major versions and release date of Ruby?
Here's major Ruby versions release date.
- Ruby 1.6 →
- Ruby 1.8 →
- Ruby 1.9.1 → (major change. Not compatible with 1.8)
- Ruby 1.9.3 →
- Ruby 2.0.0 → . 100% compatible with 1.9.
How to install Rails?
To install Rails, first you need to install Ruby, then use RubyGems to install Rails, like this:
sudo gem install rails
do not use linux
apt-get to install, because that's usually too outdated
[see Ruby: What's RVM, Gem, Rake, Bundler, RDoc, ri, irb?]
sudo apt-get install libsqlite3-dev sqlite3.
To be safe, run the following to install many common packages needed by Rails.
sudo apt-get 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 libtool bison subversion pkg-config
What are the Rails commands?
rails --help. Sample output:
◆ rails --help Usage: rails COMMAND [ARGS] The most common rails commands are: generate Generate new code (short-cut alias: "g") console Start the Rails console (short-cut alias: "c") server Start the Rails server (short-cut alias: "s") dbconsole Start a console for the database specified in config/database.yml (short-cut alias: "db") new Create a new Rails application. "rails new my_app" creates a new application called MyApp in "./my_app" In addition to those, there are: application Generate the Rails application code destroy Undo code generated with "generate" (short-cut alias: "d") benchmarker See how fast a piece of code runs profiler Get profile information from a piece of code plugin Install a plugin runner Run a piece of code in the application environment (short-cut alias: "r") All commands can be run with -h (or --help) for more information.