简体   繁体   English

我是否需要重新启动服务器:Ruby on Rails

[英]Do I need to restart Server : Ruby on Rails

Do I need to restart Server when i change the database host in the database.yml in Ruby on Rails.当我在 Ruby on Rails 中更改 database.yml 中的数据库主机时,是否需要重新启动服务器。 Database is Postgres.数据库是 Postgres。

I haven't worked on Ruby On Rails, and the reason i am asking this is because its a production server.我没有在 Ruby On Rails 上工作过,我问这个的原因是因为它是一个生产服务器。

You need to restart the service which responsible for running your rails application in order to take effects eg unicorn, puma or whatever used to run the applicaition.您需要重新启动负责运行 Rails 应用程序的服务才能生效,例如 unicorn、puma 或用于运行应用程序的任何东西。 not restarting the whole server itself不重新启动整个服务器本身

You need to restart you server when you need Rails to be loaded again from the start.当您需要从头开始再次加载 Rails 时,您需要重新启动服务器。

If you're adding or removing gems, then yes, you will need to restart the server.如果您要添加或删除 gem,那么是的,您将需要重新启动服务器。

If you change your version of ruby, change your Gemfile or change something from internal classes of Rails, you will need to restart it, otherwise it should be ok.如果您更改了 ruby​​ 版本、更改了 Gemfile 或更改了 Rails 内部类的某些内容,则需要重新启动它,否则应该没问题。 But if unexpected problems arise, restart the server is the first thing you should try.但是,如果出现意外问题,您应该首先尝试重新启动服务器。

Also, on a side-note, you will only see the changes just refreshing the page if config.cache_classes is set to false (which I think is the default for development, but not for production).此外,附带说明一下,如果 config.cache_classes 设置为 false(我认为这是开发的默认值,但不是生产的默认值),您只会看到刷新页面的更改。

Making changes to anything outside of app/ or config/routes.rb or db/ will require a restart.对 app/ 或 config/routes.rb 或 db/ 之外的任何内容进行更改都需要重新启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM