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?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Stop .htaccess redirect with query string
- Eager-loading association count with Arel (Rails 3
- Is there a way to remove IDV Tags from an AIFF fil
相关文章
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
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.Some code will require you to restart the app--examples of this is anything in
config/initializers
andvendor
.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 oftmp/restart.txt
, which will trigger Passenger to restart the app.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
.You can also use passenger by itself in development using the standalone mode. From your project directory, type