简体   繁体   English

如何从Heroku本地部署Rails应用

[英]How to deploy Rails app locally from Heroku

I've been asked to make some minor changes to the UI of a Rails web app that is served from Heroku. 我被要求对Heroku提供的Rails Web应用程序的UI进行一些小的更改。 I've cloned the git rep locally, made some changes, and now I want to test the changes on my phone - without pushing them live. 我已经在本地克隆了git rep,进行了一些更改,现在我想在我的手机上测试更改-无需实时发布。 Do I need a local heroku install? 我需要在本地安装Heroku吗? I want to preview this on an iPhone if possible, and an Android device would be helpful as well. 我想尽可能在​​iPhone上进行预览,而Android设备也将有所帮助。

I'm obviously new at Heroku and Rails, so any help is appreciated greatly. 我显然是Heroku和Rails的新人,因此对您的帮助将不胜感激。

thanks in advance 提前致谢

I believe with Heroku you can use a testing server and a production server. 我相信使用Heroku可以使用测试服务器和生产服务器。 So you could push to your testing to make sure everything is good then push to the production if everything is good. 因此,您可以进行测试以确保一切都很好,如果一切都很好,则可以进行生产。

Maybe you are looking for heroku local . 也许您正在寻找heroku localheroku local https://devcenter.heroku.com/articles/heroku-local https://devcenter.heroku.com/articles/heroku-local

Or you can just rails s -b 0.0.0.0 and in your phone go to http://server-ip:3000 (you don't need Heroku at all). 或者,您也可以只使用rails s -b 0.0.0.0然后在手机中访问http://server-ip:3000 (您根本不需要Heroku)。

After you are done with your changes you can push them to heroku with git push heroku master (if you have access from the Heroku dashboard). 完成更改后,可以使用git push heroku master将它们推送到heroku(如果您可以从Heroku仪表板进行访问)。

Some people are pointing out the option of using heroku local , but I would also like to mention using Heroku Pipelines as a solution. 有人指出使用heroku local的选项,但我也想提及使用Heroku Pipelines作为解决方案。

A pipeline is a group of Heroku apps that share the same codebase. 管道是一组共享相同代码库的Heroku应用程序。 Apps in a pipeline are grouped into “review”, “development”, “staging”, and “production” stages representing different deployment steps in a continuous delivery workflow 管道中的应用程序分为“回顾”,“开发”,“阶段”和“生产”阶段,代表了持续交付工作流程中的不同部署步骤

So you could have a "staging" stage to which you initially deploy your app to. 因此,您可以将应用程序最初部署到的“过渡”阶段。 Test it as much as you'd like, and when you are ready, promote it to "production." 对其进行尽可能多的测试,并在准备就绪时将其升级为“生产”版本。

I've been using this method for awhile for a few of my applications, and it works great. 我已经在我的一些应用程序中使用了这种方法一段时间,并且效果很好。

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

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