威尼斯wns.9778官网活动_vnsc威尼斯城官网

热门关键词: 威尼斯wns.9778官网活动,vnsc威尼斯城官网
当前位置:威尼斯wns.9778官网活动 > 计算机教程 > Debian中ruby on rails运行环境的搭建威尼斯wns.9778官

Debian中ruby on rails运行环境的搭建威尼斯wns.9778官

文章作者:计算机教程 上传时间:2019-06-21

环境:Fedora 9

很久之前的笔记了,现在整理出来, 这里采用的是Apache Mongrel Cluster, 其实shitou个人还是喜欢Lighttpd FastCGI搭配的说,因为其他原因只能现在跑这样的环境啦- -||

  1. 安装 ruby

软件:

[root@www ~]# yum install ruby* -y

ruby-1.8.7-p72.tar.gz

  1. 更新ruby

rubygems-1.3.0.tgz

[root@www ~]# gem update --system
[root@www ~]# gem update

ruby-zlib-0.6.0.tar.gz

3.install Rails and dependencies

mysql-ruby-2.8.tar.gz

[root@www~]gem install rails –include-dependencies

安装:

4.安装常用的gem包

安装ruby

[root@www ~]# gem install ruby-debug ruby-debug-base sqlite3-ruby
Successfully installed ruby-debug-0.10.2
Building native extensions. This could take a while...
Successfully installed ruby-debug-base-0.10.2
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.2.4

#apt-get install gcc libc6-dev make tmake autogen automake

3 gems installed

build-essential indent intltool

Installing ri documentation for ruby-debug-0.10.2...
Installing ri documentation for ruby-debug-base-0.10.2...
Installing ri documentation for sqlite3-ruby-1.2.4...
Installing RDoc documentation for ruby-debug-0.10.2...
Installing RDoc documentation for ruby-debug-base-0.10.2...
Installing RDoc documentation for sqlite3-ruby-1.2.4...
[root@www ~]#

#tar zxvf ruby-1.8.7-p72.tar.gz

  1. install Mongrel
    方法同4

#cd ruby-1.8.7-p72

[root@www ~]# gem install mongrel

##开启最后一行的zlib支持

  1. 若使用mysql, 还可能需要执行以下操作

#vi ext/Setup

[root@www ~]# yum install mysql*
[root@www ~]# gem install mysql

#./configure --prefix=/usr/local/ruby

  1. 安装 & 配置Apache

#make; make install

[root@www~]yum install httpd

##把/usr/local/ruby/bin加入环境变量PATH中, 并写入文件/root/.profile中

新建/etc/httpd/conf.d/rails.conf内容如下

#apt-get install zlib1g-dev

Listen 8080

#cd ext/zlib

ProxyRequests Off

#ruby extconf.rb;

BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
#BalancerMember http://127.0.0.1:3003
#BalancerMember http://127.0.0.1:3004
#BalancerMember http://127.0.0.1:3005

#make; make install

 

安装rubygems

ServerName www.laiyunqing.com:8080
DocumentRoot /var/www/beeblio/public
ProxyPass /image !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass / balancer://myCluster/
ProxyPassReverse / balancer://myCluster/
ProxyPreserveHost on

#tar zxvf rubygems-1.3.0.tgz

然后在3001,3002...3005端口启动mongrel

#cd rubygems-1.3.0

mongrel_rails start -e production -p 3001 -d -c /var/www/beeblio/ -P /var/www/beeblio/log/mongrel-3001.pid
mongrel_rails start -e production -p 3001 -d -c /var/www/beeblio/ -P /var/www/beeblio/log/mongrel-3002.pid
...

#ruby setup.rb

  1. 重启apache,试试地址栏中输入http://localhost:8080,该工作了吧?

安装rails

[root@www~]service httpd restart 

#gem install rails –version 2.0.2

威尼斯wns.9778官网活动 1

威尼斯wns.9778官网活动,支持rails console

#apt-get install libreadline5-dev

#cd ruby-1.8.7-p72/ext/readline

#ruby extconf.rb

#make; make install

在不安装SSL的话rails应用启动会报错

#apt-get install libssl-dev

#cd ruby-1.8.7-p72/ext/openssl

#ruby extconf.rb

#make; make install

本文由威尼斯wns.9778官网活动发布于计算机教程,转载请注明出处:Debian中ruby on rails运行环境的搭建威尼斯wns.9778官

关键词: