1

我在 as x 设备上运行一些 rails 应用程序,该应用程序在我的本地以生产模式运行,因为该应用程序是为 linux 系统设计的。问题是每次我想刷新视图时都必须重新启动服务器。我该如何解决这个问题?我用谷歌搜索,发现这个技巧可以运行touch tmp/restart.txt,但它对我没有任何改变

4

2 回答 2

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
于 2013-06-24T13:08:55.447 回答
1

启动 Rails 服务器时,您可以指定您的环境:

尝试运行:

rails server -e development
于 2013-06-24T13:04:35.910 回答