我什么时候应该重新启动 webrick,什么时候不应该重新启动?

发布于 2024-12-19 12:33:59 字数 133 浏览 5 评论 0原文

我目前正在学习开发 Ruby on Rails 应用程序。

如果我在视图中进行更改,我是否需要重新启动 webrick ?控制器、模型怎么样?

在 Rails 应用程序开发过程中,我应该什么时候重新启动 webrick?

I'm currently learning developing ruby on rails applications.

If i make changes in the views should i need to restart webrick ? What about controllers, models ?

When exactly should i restart webrick during development of a rails app ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

隐诗 2024-12-26 12:33:59

视图和控制器、公共文件夹中的更改 -- 不要重新启动

模型 -- 有时重新启动,有时不重新启动

其他所有 -- 重新启动

当您感到困惑并且事情不起作用时 -- 重新启动

Views and Controllers, changes in public folder -- Don't Restart

Model -- Sometimes restart, sometimes not

Everything Else -- Researt

When you are confused and things don't work -- Restart

半窗疏影 2024-12-26 12:33:59

经验法则是,在编码时不必重新启动,但在配置时重新启动。

例如,视图的变化->代码-> 模型中没有重新启动

更改 ->代码->没有重新启动

但是:

config/ 目录下的任何内容都发生了变化(环境、路由...)->配置->重新启动

在 Gemfile 中添加了一个新的 gem ->捆绑安装 ->配置->重新启动

The rule of the thumb is You don't restart when you code but you restart when you configure.

For instance, changes in views -> code -> no restart

changes in models -> code -> no restart

But:

changes in anything under config/ directory (environments, routes, ...) -> configuration -> restart

Added a new gem to Gemfile -> bundle install -> configuration -> restart

残月升风 2024-12-26 12:33:59

在以下情况下重新启动:

  • 您修改数据库(例如,rake db:migrate
  • 您修改配置文件
  • 您添加 gem

除此之外,您可以非常安全地让 webrick 运行以进行所有其他更改。

Restart when:

  • you modify the database (e.g., rake db:migrate)
  • you modify configuration files
  • you add gems

Other than that, you can pretty safely leave webrick running for all other changes.

指尖微凉心微凉 2024-12-26 12:33:59

如果您的视图发生了更改,并且尽管您刷新了页面,但该更改并未反映在您的网络浏览器上。发生这种情况是因为它存储在高速缓存中。此时您无需重新启动WEBrick。只需清除缓存即可。
建议每当您对 gemfile 进行任何更改时,都应重新启动 WEBrick。

If you have changed in views and that is not reflecting on your web browser though you have refresh the page. This happens because it is stored in cache memory. At this time you no need to restart the WEBrick. Just clear the cache memory.
And it is recommended that whenever you made any changes to gemfile you should restart the WEBrick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文