CentOS6.2 Install Rvm+ruby+rails (1) RVM The official website should be revised once,
Using Java code
- Curl-l https://get.rvm.io | bash-s stable
Download and install the RVM stable version. Not using Bash < < (Curl-s HTTPS://RVM.BEGINRESCUEEND.COM/INSTALL/RVM), remember.
Soon after installing RVM, re-login to a new SSH, using RVM-V to check the version.
(2) Install some libraries, compile and install other software or libraries will be used when
Java code
- Yum Install zlib zlib-devel sqlite-devel
The final message is roughly as follows:
Java code
- ...... kb/s | 124 KB xx:
- Running Rpm_check_debug
- Running Transaction Test
- Transaction Test Succeeded
- Running Transaction
- installing:sqlite-devel-3.6. 20-1.el6.i686 1/2
- installing:zlib-devel-1.2. 3-27.el6.i686 2/2
- Installed:
- sqlite-devel.i686 0:3.6. 20-1.el6 zlib-devel.i686 0:1.2. 3-27.el6
- complete!
(3) It is strongly recommended that you install OpenSSL before installing Ruby, or you may have to reinstall Ruby if you want to use SSL later.
Java code
- RVM Pkg Install OpenSSL
After the installation is complete, there is the following information, if the installation error, there is also a prompt notice you where to view the log.
Java code
- [Root@localhost config]# rvm pkg Install OpenSSL
- Fetching openssl-0.9.8t.tar.gz to/usr/local/rvm/archives
- Extracting openssl-0.9.8t.tar.gz to/usr/local/rvm/src
- Configuring OpenSSL in/usr/local/rvm/src/openssl-0.9.8t.
- Compiling OpenSSL in/usr/local/rvm/src/openssl-0.9.8t.
- Installing OpenSSL TO/USR/LOCAL/RVM/USR
Different operating systems or users, the installation location may not be the same.
(4) Specify the OpenSSL location to install Ruby
Tip There are some libraries that may need to be installed, so make a decision as to whether you need yum to install some libraries since.
Java code
- Yum install-y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 A utoconf automake Libtool Bison iconv-devel
You can install some of the above libraries before you install Ruby
Java code
- RVM install 1.9. 2--with-openssl-dir=/usr/local/rvm/usr
After I read the message, Q introduced a hint that no other dependent libraries were installed and continued to install Ruby.
Java code
- ......
- Press ' Q ' to continue.
- Fetching yaml-0.1. 4.tar.gz to/usr/local/rvm/archives
- % total% Received% xferd Average speed Time Time current
- Dload Upload Total spent
- 460k 460k 0 0 29602 0 0:xx: 0:xx:--:--:-- 34256
- Extracting yaml-0.1. 4.tar.gz to/usr/local/rvm/src
- Configuring Yaml in/usr/local/rvm/src/yaml-0.1. 4.
- Compiling Yaml in/usr/local/rvm/src/yaml-0.1. 4.
- Installing Yaml TO/USR/LOCAL/RVM/USR
- Installing Ruby from Source to:/usr/local/rvm/rubies/ruby-1.9. 2-p320, this could take a while the depending on your CPU (s) ...
- ruby-1.9. 2-p320-#fetching
- ruby-1.9. 2-p320-#downloading ruby-1.9. 2-p320, this is a while depending on your connection ...
- % total% Received% xferd Average speed Time Time current
- Dload Upload Total spent
- 8770k 8770k 0 0 44230 0 0: from: 0::--:--:-- 55436
- ruby-1.9. 2-p320-#extracting ruby-1.9. 2-p320 to/usr/local/rvm/src/ruby-1.9. 2-p320
- ruby-1.9. 2-p320-#extracted to/usr/local/rvm/src/ruby-1.9. 2-p320
- ruby-1.9. 2-p320-#configuring
- ruby-1.9. 2-p320-#compiling
- ruby-1.9. 2-p320-#installing
- Retrieving rubygems-1.8. -
- % total% Received% xferd Average speed Time Time current
- Dload Upload Total spent
- 371k 371k 0 0 38121 0 0:xx: 0:xx:--:--:-- 38064
- Extracting rubygems-1.8. ...
- Removing old Rubygems files ...
- Installing rubygems-1.8. For ruby-1.9. 2-p320 ...
- Installation of RubyGems completed successfully.
- ruby-1.9. 2-p320-adjusting #shebangs for (Gem IRB erb ri rdoc testrb rake).
- ruby-1.9. 2-p320-#importing default gemsets (/usr/local/rvm/gemsets/)
- Install of ruby-1.9. 2-p320-#complete
(5) RVM use 1.9.2
(6) Gem install Rails
Java code
- fetching:i18n-0.6. 0.gem (100%)
- fetching:multi_json-1.3. 6.gem (100%)
- fetching:activesupport-3.2. 6.gem (100%)
- fetching:builder-3.0. 0.gem (100%)
- fetching:activemodel-3.2. 6.gem (100%)
- fetching:rack-1.4. 1.gem (100%)
- fetching:rack-cache-1.2.gem (100%)
- fetching:rack-test-0.6. 1.gem (100%)
- fetching:journey-1.0. 4.gem (100%)
- fetching:hike-1.2. 1.gem (100%)
- fetching:tilt-1.3. 3.gem (100%)
- fetching:sprockets-2.1. 3.gem (100%)
- fetching:erubis-2.7. 0.gem (100%)
- fetching:actionpack-3.2. 6.gem (100%)
- fetching:arel-3.0. 2.gem (100%)
- fetching:tzinfo-0.3. 33.gem (100%)
- fetching:activerecord-3.2. 6.gem (100%)
- fetching:activeresource-3.2. 6.gem (100%)
- fetching:mime-types-1.19.gem (100%)
- fetching:polyglot-0.3. 3.gem (100%)
- fetching:treetop-1.4. 10.gem (100%)
- fetching:mail-2.4. 4.gem (100%)
- fetching:actionmailer-3.2. 6.gem (100%)
- fetching:rack-ssl-1.3. 2.gem (100%)
- fetching:thor-0.15. 4.gem (100%)
- fetching:json-1.7. 3.gem (100%)
- Building native extensions. This could take a while ...
- fetching:rdoc-3.12.gem (100%)
- ......
Now that the installation is complete, verify it later.
Go to CentOS and install Rvm+ruby+rails