centos 安装ruby on rails +mysql 环境搭建_MySQL
程序员文章站
2022-03-07 20:41:52
...
CentOSRuby
安装环境
centos 5.5
centos 5.5
1、更新centos源
cd /etc/yum.repos.dmv CentOS-Base.repo CentOS-Base.repo.savewget http://mirrors.163.com/.help/CentOS-Base-163.repoyum makecache
2、安装准备工作
yum -y install gcc*yum -y install gcc-c++*yum -y install curses-devel*yum -y install curses*yum install -y cmake bison bashyum install curlyum install curl-develyum install zlib-develyum install openssl-develyum install perlyum install cpioyum install expat-develyum install gettext-develyum install autoconfyum install sqlite*yum install ruby-devel sqlite-develyum install ntp*
3、安装mysql
groupadd mysqluseradd -g mysql mysqlwget 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.gzcd Percona-Server-5.5.20-rel24.1cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DWITH_INNOBASE_STORAGE_ENGINE=1make 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/mysqlcp /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnfmkdie -pv /data/mysqlchown mysql.mysql /data/mysqlvi my.cnf 加入datadir = /data/mysql pid-file=/data/mysql/hostname.pidcd /usr/local/mysql//usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql --user=mysql/etc/init.d/mysql start
4、安装git
wget http://www.sunfreeware.com/SOURCES/git-1.7.6.tar.gzcd git-1.7.6./configure --prefix=/usr/local/gitmake&&make install/cp -rf /usr/local/git/bin/* /usr/bin
5、安装rvm,rails,ruby 以及相关
bash -s -- --version latest
6、安装python
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz;tar zxvf Python-2.7.2.tgzcd Python-2.7.2./configure --enable-unicode=ucs4make && 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
7、同步下系统时间
/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
8、安装mysql2
gem install mysql2 -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/bin/mysql_config
9、安装sqlite3
wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gztar zxvf sqlite-autoconf-3071000.tar.gz cd sqlite-autoconf-3071000 ./configure --disable-tclmake && make instal
10、安装node.js
wget http://nodejs.org/dist/v0.7.6/node-v0.7.6.tar.gztar zxvf node-v0.7.6.tar.gz cd node-v0.7.6 ./configure make && make install
在创建项目的时候只要把 Gemfile 里的 source 'https://rubygems.org' 替换成 source 'http://ruby.taobao.org'就可以了
上一篇: java常用设计模式
下一篇: php的smarty模板引擎有哪些特点
推荐阅读
-
CentOS6.5下安装JDK1.7+MYSQL5.5+TOMCAT7+nginx1.7.5环境安装文档
-
Centos7下编译安装配置Nginx+PHP+MySql环境
-
CentOS7环境下免编译二进制包安装MySQL5.6教程
-
LNMP小项目搭建,Centos7.6环境搭建Linux+nginx+mysql+php,wordpress个人博客的搭建(完整搭建步骤)
-
centos下yum搭建安装linux+apache+mysql+php环境教程
-
Linux centos7环境下MySQL安装教程
-
Centos 6.8编译安装LNMP环境(Nginx+MySQL+PHP)教程
-
Linux系统下搭建MantisBT环境以及Apache+PHP+MySql的安装
-
CentOS7环境下源码安装MySQL5.7的方法
-
CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境