Ruby & rails installation process description

Source: Internet
Author: User

1. Create a user

2. Assign Permissions
First, add a user group:

Groupadd humou
Add a user, set the main directory and shell path

Useradd-G humou-D/home/humou-S/bin/bash-M humou
If the shell path is set incorrectly, the user cannot log on.
Or directly:

Useradd-G humou
Set Password

Passwd humou
Delete A User:

Userdel humou
The corresponding user group will also be deleted.
View the information of a user:

Id humou
View all users in the system:

CAT/etc/passwd
Grant sudo permissions to common users:

Mongodo
Find:

Root all = (all) All
Add

Humou all = (all) All
If you do not need to enter the password when using sudo, it is:

Humou all = nopasswd: All

3. Install the required linux package
Sudo apt-Get install build-essential bison OpenSSL libreadline6 libreadline6-dev curl Git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev Autoconf libc6-dev zlib1g-dev libssl-dev build-essential curl Git- core libc6-dev g ++ gcc

4. Install rvm
Bash <(curl-s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Load rvm (only loaded at the first installation)
Source. bashrc

$ sudo apt-get install nodejs

5. Ruby installation and switching
List known Ruby versions
Rvm List known
Install a ruby version
Rvm install 1.9.3
The latest 1.9.3 is installed here. You can install it in the rvm List known list.

Use a ruby version
Rvm use 1.9.3
If you want to set it to the default version, you can

Rvm use 1.9.3 -- default
Query installed Ruby
Rvm list
Uninstall an installed version
Rvm remove 1.9.2

6. Install the yaml Library:
Apt-Get install libyaml-Dev

7. Because there are differences between different versions of gem, we often need to create an additional gemset that contains a series of gem. For this tutorial, we recommend that you create a gemset named railstutorial_rails_4_0:
Rvm use 2.0.0 @ railstutorial_rails_4_0 -- create -- default

8. Install rubygems
Rubygems is a package management program for Ruby projects. Many useful code libraries (including rails) can be obtained through packages (or gem. After Ruby is installed, it is easy to install rubygems. If you have installed rvm, you have already installed rubygems, because rvm has automatically installed it:
Which gem
/Users/mhartl/. rvm/rubies/ruby-2.0.0-p0/bin/gem
Gem update -- System 2.0.0

When installing the gem, rubygems generates two different documents (RI and rdoc) by default, but many Ruby and rails developers think that it is unnecessary to generate these documents at the time. (Many programmers rely more on online documents than built-in RI and rdoc documents .) To disable automatic document generation, we recommend that you execute the command in code 1.1 and create a gem configuration file named. gemrc in the home directory. For details about the file, see Code 1.2. (Wave number "~" Indicates the "home directory". The dot in. gemrc indicates that this is a hidden file, and the configuration files are generally hidden .)

$ Subl ~ /. Gemrc

Code 1.2: do not generate RI and rdoc documents in. gemrc Configuration
Install: -- no-rdoc -- no-ri
Update: -- no-rdoc -- no-ri

9. Install rails
Gem install rails -- version 4.0.0 -- no-ri -- no-rdoc

$ Rails-V
Rails 4.0.0
If you are using Linux, you may need to install some other code packages:
$ Sudo apt-Get install libxslt-dev libxml2-dev libsqlite3-dev # For Linux only


Gem update -- System

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.