search
Homephp教程PHP源码Ubuntu 7.1 server从无到有搭建jsp/php/rails全能WEB生产环境(五)

<script>ec(2);</script>

五、安装Rails环境

Rails环境使用Mongrel架设。
1、安装ruby
tar -zxvf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure –prefix=/usr/local/ruby
make
make install

将ruby加入PATH
vi /etc/profile
RUBY_HOME=/usr/local/ruby
PATH=”${RUBY_HOME}”/bin:”${JAVA_HOME}”/bin:/usr/local/mysql/bin:”${PATH}”
export PATH

退出root,重新用root登陆,验证ruby是否安装成功
ruby -v
显示版本号,说明安装成功

2、安装gem
tar -zxvf rubygems-0.9.4.tgz
cd rubygems-0.9.4
ruby setup.rb

rubygems-0.9.5好像有问题,无论gem什么包都说ssl没有安装,重新安装个rubygems-0.9.4就没问题了。
3、安装rails/mongrel/termios
apt-get install libssl-dev
gem install rake –include-dependencies
gem install rails –include-dependencies
gem install termios –include-dependencies
gem install mongrel –include-dependencies
gem install mongrel_cluster –include-dependencies

生成一个默认站点(或者将已经开发的网站上传,并配置好数据库)后,转到站点目录
mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /home/dingl/rails-web/ -a 127.0.0.1
在database.yml中配置好数据库,这里是生产环境,配置production段。
如果需要使用socket方式连接mysql,增加:
socket: /tmp/mysql.sock
同时还可以指定数据传输编码:
encoding: utf8

4、启动mongrel:
mongrel_rails cluster::start

如果出现以下错误:
Cannot find gem for Rails ~>1.2.3.0:
Install the missing gem with ‘gem install -v=1.2.3 rails’
则修改config/environment.rb里rails的版本号即可

5、配置Apache与Mongrel:

修改apache的配置文件:
vi /usr/local/apache/conf/httpd.conf
在文件最后增加一个虚拟主机:

  ServerName http://www.111cn.net/
  RewriteEngine On
  DocumentRoot /home/dingl/rails-web/
  ProxyRequests Off
 
    BalancerMember http:/

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
在 Mac 上创建 Windows 11 USB 安装程序的 3 种简单方法在 Mac 上创建 Windows 11 USB 安装程序的 3 种简单方法May 13, 2023 pm 09:43 PM

Windows11引入了丰富的新功能以及全面改进的外观,更加强调统一性和效率。因此,今天的主题是如何在Mac上创建Windows11USB安装程序。执行Windows11的全新安装而不是升级,是在获取操作系统时产生最佳结果的方法。使用可在Windows11中启动的驱动器,您可以执行此任务。如果您使用的是WindowsPC,则为Windows11制作可引导CD是一个非常简单的过程。另一方面,如果您使用的是Mac,则该过程会稍微复杂一些。这篇文章将描述如何在不使用基

如何在 Windows 10 上使用命令提示符安装 PHP如何在 Windows 10 上使用命令提示符安装 PHPMay 08, 2023 pm 05:13 PM

使用命令提示符或PowerShell在Windows上安装PHP安装ChocolateyChoco包管理器我尝试了Windows默认包管理器Winget,但无法通过它安装PHP。因此,剩下的另一个最佳选择是使用流行的Chocolatey包管理器。但与Winget不同的是,Choco默认情况下不存在于我们的Windows系统中,因此我们需要在我们的系统上手动安装它。转到您的Windows10或11搜索框并键入CMD,出现时选择“以管理员身份运行”将给定的命令复制

如何在新的 SSD 上安装 macOS如何在新的 SSD 上安装 macOSApr 13, 2023 pm 04:01 PM

如何使用 macOS Recovery 在新的 SSD 上安装 macOS在 2009 年之后生产的任何 Mac 上,都有一个内置的恢复系统。这允许您将 Mac 启动到恢复模式。在此模式下,您可以修复内部磁盘、从 Time Machine 备份恢复文件、获取在线帮助或重新安装 macOS。您必须能够连接到互联网才能使用这些工具。您可以使用 macOS 安装工具在计算机中安装的新 SSD 上安装 macOS。要使用 Internet Recovery 在 SSD 上安装 macOS:按照制造商针对

Rails实现HTML转PDF的方法Rails实现HTML转PDF的方法Aug 27, 2023 pm 12:49 PM

在Ruby和Rails中生成PDF的方法有很多种。您可能已经熟悉HTML和CSS,因此我们将使用PDFKit通过标准Rails视图和样式代码中的HTML生成PDF文件。PDFKit简介在内部,PDFKit使用wkhtmltopdf(WebKitHTML到PDF),这是一个引擎,它将采用HTML和CSS,使用WebKit渲染它,并将其输出为高质量的PDF。首先,请在您的计算机上安装wkhtmltopdf。您可以下载二进制文件或从Mac上的Brew或您首选的Linux存储库进行安装。您还需要安装pd

为什么 Python、Ruby 等语言弃用了自增运算符?为什么 Python、Ruby 等语言弃用了自增运算符?May 11, 2023 pm 04:37 PM

许多人也许会注意到一个现象,那就是在一些现代编程语言(当然,并不是指“最近出现”的编程语言)中,自增和自减运算符被取消了。也就是说,在这些语言中不存在​​i++​​​或​​j--​​​这样的表达,而是只存在​​i+=1​​​或​​j-=1​​这样的表达方式了。本回答将从设计哲学这个角度上探讨这一现象产生的背景与原因。严格来说,说"i++正在消失"也许有失偏颇,因为主流编程语言中似乎只有Python、Rust和Swift不支持自增自减运算符。​当我第一次接触Python时,这也

深入分析 Golang 与 Ruby 的异同深入分析 Golang 与 Ruby 的异同Jun 01, 2024 pm 08:46 PM

Go与Ruby的主要区别在于:Go是一种静态类型编译语言,支持轻量级并行和高效内存管理,适合编写高并发应用程序;Ruby是一种动态类型解释语言,支持真正的并行但内存管理需手动控制,适合编写灵活的Web应用程序。

Ruby怎么使用Mysql2连接操作MySQLRuby怎么使用Mysql2连接操作MySQLApr 17, 2023 pm 10:07 PM

Ruby操作MySQL使用mysql2连接mysql并操作mysql。geminstallmysql2连接mysql建立连接:require&#39;mysql2&#39;conn=Mysql2::Client.new({host:&#39;192.168.200.73&#39;,username:&#39;root&#39;,password:&#39;P@ssword1!&#39;})接受的连接选项包括:Mysql2::Clie

如何使用MySQL和Ruby实现一个简单的数据分析报表功能如何使用MySQL和Ruby实现一个简单的数据分析报表功能Sep 20, 2023 pm 05:09 PM

如何使用MySQL和Ruby实现一个简单的数据分析报表功能引言:在当今数据驱动的时代,数据分析对于企业的决策和发展起到了至关重要的作用。而数据分析报表作为数据分析的重要组成部分,对于对数据进行整理、可视化和解读具有重要意义。本文将介绍如何使用MySQL和Ruby来实现一个简单的数据分析报表功能,并提供相应的代码示例。一、数据库设计与建表要实现数据分析报表功能

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function