启动后自动启动 Rails 服务器 [英] Start Rails server automatically after boot

查看:74
本文介绍了启动后自动启动 Rails 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要 cd 到一个目录并在启动后运行rails server"命令.例子

I need to cd to a directory and run the 'rails server' command after bootup. example

cd/home/bab/rails/app/

cd /home/bab/rails/app/

然后当我在 app 目录中时,它运行 rails server 命令.

then when am in the app directory it runs the rails server command.

有人可以帮我解决这个问题吗...使用 ubuntu 9.10 和 rails 3.0.0

Can some1 help me with this...using ubuntu 9.10 and rails 3.0.0

推荐答案

尝试添加到 /etc/rc.local 这个:

ruby /path/to/your/app/script/rails s -P /path/to/your/app/tmp/pids/server.pid -c /path/to/your/app/config.ru -d

但最好将 passenger gem 与 Nginx 或 Apache 一起使用

But better to use passenger gem here with Nginx or Apache

http://modrails.com/

易于设置和使用

这篇关于启动后自动启动 Rails 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆