Ruby on Rails installation and Hello World

Source: Internet
Author: User
Tags ruby on rails

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.