1
我試圖從Rails 5.0升級到Rails 5.1.1。rails應用程序:更新衝突 - 最簡潔的方式來選擇文件內容?
運行rails app:update
導致各種衝突,其中Rails 5.1.1具有與Rails 5.0相同名稱的文件,並且我被問到我想要做什麼。
的「差異」對「development.rb」是這樣的:
config.cache_store = :memory_store
config.public_file_server.headers = {
- 'Cache-Control' => 'public, max-age=172800'
+ 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
}
else
config.action_controller.perform_caching = false
@@ -30,8 +30,6 @@
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
- host = 'localhost:3000' # Local server
- config.action_mailer.default_url_options = { host: host, protocol: 'http' }
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
因此,在這種情況下,我很高興爲「緩存控制」線被改變,但希望其他2行('host ..','config ...')單獨留下。
我知道如何選擇舊文件或新文件,但是當你想要兩者的一部分時你會做什麼?在交互過程完成後,您是否將所需的內容複製到單獨的文件並粘貼,或者是否存在更簡潔的方法?
感謝。在我意識到運行rails應用程序:更新導致與現有文件('development.rb')一起創建提議的新文件('development_something.rb')並允許您在兩者之間進行選擇之後,我意識到我可以將建議的新文件中需要的內容複製到現有文件中,然後選擇現有文件。 –