安裝環境node
centos 5.5 python
一、更新centos源mysql
cd /etc/yum.repos.d mv CentOS-Base.repo CentOS-Base.repo.save wget http://mirrors.163.com/.help/CentOS-Base-163.repo yum makecache
二、安裝準備工做
yum -y install gcc* yum -y install gcc-c++* yum -y install curses-devel* yum -y install curses* yum install -y cmake bison bash yum install curl yum install curl-devel yum install zlib-devel yum install openssl-devel yum install perl yum install cpio yum install expat-devel yum install gettext-devel yum install autoconf yum install sqlite* yum install ruby-devel sqlite-devel yum install ntp*
三、安裝mysql
groupadd mysql useradd -g mysql mysql wget http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.20-24.1/source/Percona-Server-5.5.20-rel24.1.tar.gz cd Percona-Server-5.5.20-rel24.1 cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DWITH_INNOBASE_STORAGE_ENGINE=1 make make install \cp -rf /usr/local/mysql/bin/* /usr/bin \cp -rf /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql chmod 755 /etc/init.d/mysql cp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf mkdie -pv /data/mysql chown mysql.mysql /data/mysql vi my.cnf 加入 datadir = /data/mysql pid-file=/data/mysql/hostname.pid cd /usr/local/mysql/ /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql /etc/init.d/mysql start
四、安裝gitc++
wget http://www.sunfreeware.com/SOURCES/git-1.7.6.tar.gz cd git-1.7.6 ./configure --prefix=/usr/local/git make&&make install \cp -rf /usr/local/git/bin/* /usr/bin
五、安裝rvm,rails,ruby 以及相關git
bash -s -- --version latest < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) rvm pkg install readline rvm install 1.9.3 --with-readline-dir=$rvm_path/usr rvm 1.9.3 --default gem source -r http://rubygems.org/ gem source -a http://ruby.taobao.org gem install bundler rails gem -update system
六、安裝pythongithub
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz; tar zxvf Python-2.7.2.tgz cd Python-2.7.2 ./configure --enable-unicode=ucs4 make && make install.
yum install -y bzip2* cd Python-2.7.2/Modules/zlib ./configure ; make; make install cd python2.7 python2.7 setup.py install
七、同步下系統時間sql
/usr/sbin/ntpdate ntp.api.bz; hwclock --systohc; echo "01 * * * * /usr/sbin/ntpdate ntp.api.bz" >> /var/spool/cron/root /etc/rc.d/init.d/crond restart
八、安裝mysql2shell
gem install mysql2 -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/bin/mysql_config
九、安裝sqlite3
wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz tar zxvf sqlite-autoconf-3071000.tar.gz cd sqlite-autoconf-3071000 ./configure --disable-tcl make && make instal
gem install sqlite3
安裝node.jscentos
wget http://nodejs.org/dist/v0.7.6/node-v0.7.6.tar.gz tar zxvf node-v0.7.6.tar.gz cd node-v0.7.6 ./configure make && make install
OK 完了api
在建立項目的時候只要把 Gemfile 裏的 source 'https://rubygems.org' 替換成 source 'http://ruby.taobao.org'就能夠了