Build a Ruby On Rails platform using CentOS

Source: Internet
Author: User

Build a Ruby On Rails platform using CentOS

System CentOS6.5 x64

Ruby On Rails is an open-source Web framework written in Ruby, similar to J2EE and PHP. Ruby On Rails is a very beautiful Web development framework and incorporates the essence of agile development: conventions are greater than configurations. You will find that it is really a very beautiful framework! Today we will introduce how to build a Ruby On Rails development environment in Centos.

Tips:

Ruby Version Manager, which includes Ruby Version management and gemset ). Currently, most Ruby versions are supported, including 1.8.7, 1.9.1, 1.9.2, and Ruby Enterprise Editon. RVM allows you to quickly switch between multiple Ruby versions. RVM also supports JRuby.

I want to work in Ruby 1.9.2 + Rails 3.0 and try the latest Rails development version. What should I do? Gemset is designed to solve this problem. It can generate multiple gemsets for each Ruby version and each gemset is independent of each other, this means that you can easily switch to a gemset to experience an unofficially released gem version without disrupting the current working environment. After that, you can switch back to the working gemset.

Most ides also support RVM. You can automatically identify the Ruby version and GemSet managed by RVM to switch the Ruby parsing environment.

Build a Ruby on Rails environment on CentOS 5.9

Configure Ruby on Rails in CentOS and deploy Redmine

Ruby on Rails and Laravel: getting started

Important article: Ruby-Linux/Windows installation, code development, and Rails practice

Ruby on rails:



Build Ruby On Rails in Ubuntu

Build Ruby on Rails on Ubuntu 13.10

Ruby on Rails 4 Tutorial Chinese Version HD complete PDF

1. Create a Common Account and view the environment files of the current environment;

[Root @ master ~] # Useradd-d/opt/Truby
[Root @ master ~] # Echo "Truby" | passwd -- stdin Truby

2. Install the rvm Source:

[Truby @ master ~] $ Curl-L get. rvm. io | bash-s stable
[Truby @ master ~] $ Source ~ /. Profile
[Truby @ master ~] $ Source ~ /. Bash_profile

Check the local changes after installing rvm:

[Truby @ master ~] $ Ls-
... Bash_history. bash_logout. bash_profile. bashrc. emacs. gnome2. gnupg. mozilla. pki. profile. rvm. zlogin. zshrc
[Truby @ master ~] $ Cd. rvm/
L [Truby @ master. rvm] $ ls
Archives config docs examples gems help installed. at LICENSE man patchsets RELEASE scripts tmp VERSION
Bin contrib environments gem-cache gemsets hooks lib log patches README rubies src user wrappers

Run the following command to upgrade RVM.
$ Rvm update

Rvm commands:

$ Rvm info
$ Rvm info 1.9.2
 
$ Rvm list known
$ Rvm install 1.9.2 # install ruby-1.9.2
$ Rvm install ree # install Ruby Enterprise Edition (REE)
 
$ Rvm ruby-1.8.7-p160 # Switch 1.8.7-p160 to the current version
$ Rvm 1.8.7-p160 # Same as above rvm ruby-1.8.7-p160
$ Ruby-v # view the current Ruby version
 
$ Which ruby
 
$ Rvm -- default use 1.9.2 # Set 1.9.2 as the default version

$ Rvm default # use default to quickly return to the default version
$ Rvm list default # view current version settings
$ Rvm reset # restore system default settings
 
$ Rvm list # list Installed Ruby versions

$ Rvm list rubies # Same as above
$ Rvm list default # display default Ruby version information
$ Rvm list known # list information about all Ruby versions supported by RVM
 
 
# Create an individual name for the Ruby version of The ree-187: reed
$ Rvm alias create reed ree-1.8.7-p2010.01

 
$ Rvm use reed # quickly switch through aliases
$ Rvm alias delete reed # delete an alias
$ Rvm alias list # view all aliases
 
 
$ Rvm remove ruby-1.9.2-p0

$ Rvm uninstall ruby-1.9.2-p0
 
$ Rvm gemset create rails3 # create a gemset named rails3

$ Rvm gemset use rails3 # use the rails3 gemset in the current Ruby Environment
 
 
# You can directly use this name to specify ruby and gemset information.
$ Rvm use ruby-1.9.2-p0 @ rails3
 
 
# Set the default value
$ Rvm use ruby-1.9.2-p0 @ rails3 -- default
 
# Select the ruby version
$ Rvm default

 
# List all gemsets in the current Ruby version
$ Rvm gemset list
 

# List all gemsets in all Ruby versions
$ Rvm gemset list_all
 
# Display current gemset Information
$ Rvm gemset name

 
$ Rvm gemdir # location
~ /. Rvm/gems/ruby-1.9.2-p0 @ rails3
 
 
$ Rvm gemset delete rails3 # Will be confirmed once

$ Rvm -- force gemset delete rails3 # delete directly without any definite steps
 
$ Rvm gemset empty rails3
$ Rvm -- force gemset empty rails3 # Delete directly without any definite steps
 
$ Rvm gemset export rails3.gems
 
$ Rvm gemset rails 3
$ Rvm gemset import rails3
 
$ Rvm gemset copy 1.8.7 @ rails3 1.9.2-head @ rails3

3. Install ruby

3.1 List known ruby versions.

[Truby @ master ~] $ Rvm list known
# MRI Rubies
[Ruby-] 1.8.6 [-p420]
[Ruby-] 1.8.7 [-head] # security released on head
[Ruby-] 1.9.1 [-p431]
[Ruby-] 1.9.2 [-p330]
[Ruby-] 1.9.3 [-p551]
[Ruby-] 2.0.0 [-p598]
[Ruby-] 2.1.4
[Ruby-] 2.1 [. 5]
[Ruby-] 2.1-head
Ruby-head
......

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.