Chinaunix首页 | 论坛 | 博客
  • 博客访问: 310564
  • 博文数量: 96
  • 博客积分: 230
  • 博客等级: 二等列兵
  • 技术积分: 722
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-13 22:25
个人简介

心安处即吾乡!

文章分类

全部博文(96)

文章存档

2016年(1)

2014年(79)

2013年(7)

2012年(9)

我的朋友

分类: 项目管理

2014-10-22 16:45:55

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.

点击(此处)折叠或打开

  1. yum -y update
  2. yum groupinstall "Development Tools"

Now we can proceed for Ruby installation
Download and install ruby as below step 

点击(此处)折叠或打开

  1. cd /opt/
  2. wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
  3. tar xvzf ruby-2.0.0-p247.tar.gz
  4. cd ruby-2.0.0-p247
  5. ./configure
  6. make
  7. make install

After completing the installation verify the ruby version: 

点击(此处)折叠或打开

  1. ruby -v
Now we will download and install rubygem 

点击(此处)折叠或打开

  1. cd /opt/
  2. wget
  3. tar xvzf rubygems-2.0.6.tgz
  4. cd rubygems-2.0.6
  5. ruby setup.rb

Now we will ensure that we have the latest gem with us by issuing below command: 

点击(此处)折叠或打开

  1. gem update --system

Output:

点击(此处)折叠或打开

  1. Latest version currently installed. Aborting.

Now we will install latest version of rails with it’s dependencies:

点击(此处)折叠或打开

  1. gem install rails
Verify the installed gems 

点击(此处)折叠或打开

  1. gem list

转自:

注意事项:
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可以从官网选择最新版本


阅读(2969) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~