我不得不重新启动Apache每次我改变我的Rails code时间 [英] I have to restart Apache every time I change my Rails code

查看:164
本文介绍了我不得不重新启动Apache每次我改变我的Rails code时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行的Rails 3 Apache和乘客。自从我从杂种切换到乘客我发现我不得不重新启动Apache的每一次我改变我的code。这是预期的行为?是为了避免此问题,在开发利用杂种的唯一途径?

I'm running Rails 3 with Apache and Passenger. Ever since I switched from Mongrel to Passenger I find that I have to restart Apache every single time I change my code. Is this the intended behavior? Is the only way to avoid this problem to use Mongrel in development?

推荐答案

假设你不得不重新启动Apache即使是模型/视图/控制器code,因为如果你已经设置了旅客来运行你的应用程序它似乎在生产环境中。您可以通过添加 RailsEnv发展你的虚拟主机解决这个问题。

Assuming you have to restart Apache even for model/view/controller code, it would seem as if you've set up Passenger to run your app in the production environment. You can fix this by appending RailsEnv development to your virtual host.

有些code将要求您重新启动应用程序 - 这样的例子在配置/初始化厂商

Some code will require you to restart the app--examples of this is anything in config/initializers and vendor.

有只重启的应用的(而不是整个服务器),这简直是触摸TMP / restart.txt 的一种方式。这将更新 TMP / restart.txt 的时间戳,这将引发乘客重新启动应用程序。

There's a way to only restart the app (and not the entire server), which is simply touch tmp/restart.txt. This will update the timestamp of tmp/restart.txt, which will trigger Passenger to restart the app.

此外,你可以做触摸TMP / always_restart.txt 。这将告诉乘客重新启动的每个的页面加载的应用程序。如果你在需要重新启动(如上面提到的例子)的部分工作,这非常有用。要停止自动重新启动,你就必须删除该文件,就像这样: RM TMP / always_restart.txt

Additionally, you can do touch tmp/always_restart.txt. This will tell Passenger to restart the app on every page load. This can be useful if you're working on sections that require restarts (such as the examples mentioned above). To stop the automatic restarting, you'll have to delete the file, like this: rm tmp/always_restart.txt.

这篇关于我不得不重新启动Apache每次我改变我的Rails code时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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