2013-06-24 38 views
1

我正在x设备上运行一些rails应用程序,该应用程序在本地生产模式下运行,因为该应用程序是为Linux系统设计的。问题是每次我想刷新我的视图时,我都必须重新启动服务器。我怎样才能解决这个问题?我GOOGLE了它,我发现这一招运行touch tmp/restart.txt,但它并没有为我刷新代码,无需重新启动服务器 - 在osx上的导轨

+0

您是否使用Passenger作为生产服务器? Passenger使用'touch tmp/restart.txt'来刷新代码。如果不是,你将不得不使用其他一些机制。 – claptimes

回答

2

如果您必须在生产环境中运行您的应用程序,然后您还可以编辑config/environments/production.rb文件并设置:

# In the development environment your application's code is reloaded on 
# every request. This slows down response time but is perfect for development 
# since you don't have to restart the web server when you make code changes. 
config.cache_classes = false 
+0

对不起,我的最新帖子,我误导,它的工作! – user1611830

1

改变什么。当你启动服务器的轨道,你可以指定你的环境:

尝试运行:

rails server -e development 
相关问题