Build Ruby on Rails environment under CentOS

Source: Internet
Author: User
Tags ruby on rails

1. Install Ruby

After the installation is successful, the input ruby-v will have version information

2. Execute gem install rails installation Rails

Implementation of the outdated wait, long time no response, after the internet to find out the resource is not found, the solution is to modify the configuration source

Configuring with the Gem Source command

Change http://rubygems.org's gem to http://http://ruby.taobao.org

Finally, make sure to keep a valid source

----------------------
Show sources currently in use
Gem sources

Add a source
Gem sources-a URL Address

Delete a source
Gem sources-r URL Address

Update Source Cache
Gem Sources-u

-----------------------

Finally use RAILS-V to see if the installation was successful

3. Next, execute the Rails new project name to create a project

Rails New Blog

4. Execute Rails Server

Open the service, you need to install a lot of third-party packages, GCC, gcc_c++, SQLite

Enter http://localhost:3000 in the browser to see the blog you created.

5. Execute rails Generate Controller Welcome index

After modifying the home page in Config/route.config and then re-opening the service after adding content to the view

Because there is no graphical interface under CentOS, the use of elinks, the effect of general-like!

The final result is as follows:

  

Build Ruby on Rails environment under CentOS

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.