CentOS Configuring Ruby on Rails Environment _ruby topics

Source: Internet
Author: User
Tags ruby on rails

Detailed installation steps:

First, update python
The default installed Python in CentOS is version 2.4, because the new rails need to provide nodejs support, need to update Python, update the article can be directly to the link Http://www.tomtalk.net/wiki/Python

Copy Code code as follows:

Yum install-y bzip2* #nodejs 0.8.5 required, install this module before you install Python.

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
Tar zvxf python-2.7.3.tgz
CD Python-2.7.3
./configure
Make && make install
/usr/local/bin/python2.7-v #查看Python版本


Establish a soft connection so that the system's default Python points to python2.7
Normally, even if the python2.7 installation is successful, the system's default pointing Python is still 2.4.3, considering that Yum is based on python2.4.3 to work properly and is not easy to uninstall.

Copy Code code as follows:

Mv/usr/bin/python/usr/bin/python.bak
Ln-s//usr/local/bin/python2.6/usr/bin/python
Python-v #检验python指向是否成功

Resolving system Python Soft links point to python2.6 version, yum not working properly
Copy Code code as follows:
$vi/usr/bin/yum
Change the #/usr/bin/python of the text edit to #/usr/bin/python2.4 and save the changes.


second, the installation of dependent packages
#yum install gcc gcc-c++ openssl* readline* ncurses* zlib* libxml* libjpeg* libpng* libxslt* libtool*
Iii. installation of Nodejs
Copy Code code as follows:

wget http://nodejs.org/dist/v0.8.5/node-v0.8.5.tar.gz
Tar zvxf node-v0.8.5.tar.gz
CD node-v0.8.5
./configure
Make && make install

Iv. It is suggested that the installation of YAML may cause an exception to the gem installation, which can be seen in detail: http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/

Copy Code code as follows:

wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Tar xzvf yaml-0.1.4.tar.gz
CD yaml-0.1.4
./configure--prefix=/usr/local
Make
Make install

V. Installation of Ruby 1.9.3

Copy Code code as follows:
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
Tar xzvf ruby-1.9.3-p0.tar.gz
CD ruby-1.9.3-p0
./configure--prefix=/usr/local--enable-shared--disable-install-doc--with-opt-dir=/usr/local/lib
Make
Make install


Vi. Upgrading the Gem and installing Rails
If the gem installation fails, you can install it by downloading the source code.
Copy Code code as follows:
wget http://rubyforge.org/frs/download.php/74445/rubygems-1.6.2.tgz
Tar zxvf rubygems-1.6.2.tgz
CD rubygems-1.6.2
Ruby Setup.rb

Gem installation success directly follow the next step
Copy Code code as follows:

Gem Update--system
Gem Install RDoc
Gem Install Rails
Rails-v

This article is from: http://www.qcoke.com/

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.