How to install Ruby on Rails on CentOS 6.4
Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.
Before installing Ruby on our machine we have to update our system and have to install some dependency applications.
-
yum -y update
-
-
yum groupinstall "Development Tools"
Now we can proceed for Ruby installation
Download and install ruby as below step
-
cd /opt/
-
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
-
tar xvzf ruby-2.0.0-p247.tar.gz
-
cd ruby-2.0.0-p247
-
./configure
-
make
-
make install
After completing the installation verify the ruby version:
Now we will download and install rubygem
-
cd /opt/
-
wget
-
tar xvzf rubygems-2.0.6.tgz
-
cd rubygems-2.0.6
-
ruby setup.rb
Now we will ensure that we have the latest gem with us by issuing below command:
Output:
-
Latest version currently installed. Aborting.
Now we will install latest version of rails with it’s dependencies:
Verify the installed gems
转自:
注意事项:
1.yum -y update命令升级系统已安装包耗时太长,可以跳过
2.ruby版本可以自由从官网选择最新ruby版本下载,安装文档中的版本在make时会报错,最新的官网版本已修复该bug:
ossl_pkey_ec.c:766:17: warning: implicit declaration of function ‘EC_GF2m_simple_method’ [-Wimplicit-function-declaration]
method = EC_GF2m_simple_method();
^
ossl_pkey_ec.c:766:24: warning: assignment makes pointer from integer without a cast [enabled by default]
method = EC_GF2m_simple_method();
^
ossl_pkey_ec.c:821:29: error: ‘EC_GROUP_new_curve_GF2m’ undeclared (first use in this function)
new_curve = EC_GROUP_new_curve_GF2m;
^
ossl_pkey_ec.c:821:29: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [ossl_pkey_ec.o] Error 1
make[2]: *** Waiting for unfinished jobs....
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
installing default ripper libraries
compiling init.c
make[2]: Leaving directory `/tmp/ruby-build.20131031165127.5126/ruby-2.0.0-p247/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
3.rubygems可以从官网选择最新版本
阅读(3027) | 评论(0) | 转发(0) |