简体   繁体   English

部署Rails应用

[英]Deploy Rails App

I have been asked to make a few cosmetic changes to our production deployment. 我被要求对我们的生产部署进行一些外观上的更改。 I have access to our linux box where I can see the files I need to change. 我可以访问我们的linux框,在其中可以看到需要更改的文件。 I only need to change html.erb files, but when I add, for instance a simple <p> tag, it does not show up live. 我只需要更改html.erb文件,但是当我添加一个简单的<p>标签时,它就不会实时显示。

I know I probably have to reset the server or redeploy the code, but I have no idea what to do. 我知道我可能必须重置服务器或重新部署代码,但是我不知道该怎么办。

Our production deployment is not fully live, so I am making changes on the fly (I know that this is not the best practice). 我们的生产部署尚未完全启用,因此我正在即时进行更改(我知道这不是最佳实践)。 Our app is running in a shared hosting environment for the moment. 目前,我们的应用程序正在共享主机环境中运行。

I have seen threads where people use Capistrano to deploy but how? 我已经看到人们使用Capistrano进行部署的线程,但是如何? We do not currently use it. 我们目前不使用它。

Can anyone help? 有人可以帮忙吗?

Whenever you make changes in production files, you have to restart the server to see the changes. 每当在生产文件中进行更改时,都必须重新启动服务器才能看到更改。 In production environment cache_classes is set to true. 在生产环境中,cache_classes设置为true。 One can disable it and changes will be reflected without restarting the server. 可以禁用它,更改将反映出来,而无需重新启动服务器。 So to reflect the change restart the server. 因此,为了反映更改,请重新启动服务器。

thanks...... 谢谢......

I found a good guide on the Capistrano github wiki and also used this guide @ kris.me.uk about a complete rails setup, including the Capistrano deployment aspect. 我在Capistrano github wiki上找到了不错的指南,还使用了@ kris.me.uk这个指南来了解完整的Rails设置,包括Capistrano部署方面。 I used them when learning how to deploy rails apps effectively. 在学习如何有效部署Rails应用程序时,我使用了它们。 They should tell you what you need to know to get a basic deployment setup up and running. 他们应该告诉您要设置和运行基本部署设置所需的知识。

I wrote a Capistrano // NGINX guide and posted it on my blog. 我写了一个Capistrano // NGINX指南,并将其发布在我的博客上。 It's 85% correct, and should help you understand the big picture of the server/Rails/SSH configurations. 正确率为85%,应该可以帮助您了解服务器/ Rails / SSH配置的概况。

http://westonplatter.com/blog/2012/08/19/rails-slash-nginx-rackspace-deployment/ http://westonplatter.com/blog/2012/08/19/rails-slash-nginx-rackspace-deployment/

Just incase someone is looking for the answer: 以防万一有人在寻找答案:

When rails is in development mode it will automatically reload changed files. 当Rails处于开发模式时,它将自动重新加载更改的文件。 When in production I need to restart it. 在生产中,我需要重新启动它。

I eventually found out that we use God (A proces monitoring framework for rails - link here ). 最终,我发现我们使用了上帝(用于铁路的过程监控框架- 链接在此处 )。

I had to restart our app with the following command: 'god restart APP_NAME' 我必须使用以下命令重新启动我们的应用:'god restart APP_NAME'

Hope that helps someone :) 希望有人帮助:)

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

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