First, environmental installation
CentOS Operating System
1, installation RVM
Curl-ssl Https://get.rvm.io | Bash-s Stable
Rvm-v to see if the installation was successful
2. Install Ruby
RVM Install 1.9.3
Ruby-v viewing the ruby version number
RVM command Simple to use introduction:
RVM Install the latest version of Ruby by default
RVM Reinstall Ruby Re-installation
RVM Remove Ruby removes the installation of Ruby
If you want to install, reload, or delete ruby, you can specify a version, that is, write the corresponding parameters behind Ruby.
3. Install Rails
Gem Install Rails-v
Rails-v to see if the installation was successful
You can install a specific version of rails, such as the gem install Rails-v 3.2.13.
Second, Vrud Hello World
1. Create a project
mkdir projects
CD projects
Rails New Demo--skip-test-unit
CD Demo
Bundle Install
2. Start the program
Rails Server-b 2.2.2.2
or Rails s-b 2.2.2.2
3. Create a crud program using scaffold
Bin/rails g scaffold person name:string bio:text birthday:date
4. Create a database table
Bin/rake db:migrate
Access to verify that the program was created successfully.
Ruby on Rails installation and Hello World