简体   繁体   English

将Rails应用程序部署到Elastic Beanstalk时遇到许多问题

[英]Many problems with deploying a rails application to Elastic Beanstalk

I'm at a breaking point with trying to get a rails application deployed to EB. 我在尝试将Rails应用程序部署到EB时遇到了一个断点。 I cannot user heroku for dependency reasons so I'm trying out AWS. 由于依赖性原因,我无法使用heroku,因此我正在尝试AWS。 The ruby/rails tutorials online all are very clear in setting up an environment, but I am met with many challenges, and at this point I'm starting to think it's because of Amazon's service and not my configuration. 网上的ruby / rails教程在设置环境方面都很明确,但是我遇到了很多挑战,因此我开始认为这是因为Amazon的服务而不是我的配置。

Lets say I start with something very simple, I run 可以说我从一个非常简单的东西开始

rails new

I start of with a barebones rails app, and I add the necessary routes and index.html.erb file to say hello word. 我首先使用准系统Rails应用程序,然后添加必要的路由和index.html.erb文件来打个招呼。 I run 我跑

git init && git add . && git commit -m "hello world" 
eb init

I run through the necessary steps, I've tried creating a 32 and 64 bit ubuntu instances with ruby 1.9.3 (Which is what my local environment is set up as), I dont set up RDS, and then run 我执行了必要的步骤,尝试使用ruby 1.9.3创建32和64位ubuntu实例(这是我在本地环境中设置的实例),我没有设置RDS,然后运行

eb start

which prompts me to deploy my latest git commit, I say yes, and it deploys! 这提示我部署最新的git commit,我说是,它就部署了!

Good news? 好消息? Not so much, Yes my url given by EB does say Hello World, but if at ANY point I try to deploy new code, lets say a change to the gemfile, and there is an error in building my gemfile.. the environment completely blocks me out to the point where. 并不是很多,是的,由EB提供的URL确实说了Hello World,但是如果在任何时候我尝试部署新代码,可以说对gemfile进行更改,并且构建我的gemfile时出错。环境完全被阻止我到了哪里。

  • I cannot access any logs, and If I try, the env goes into a grey state, and reboots 我无法访问任何日志,并且如果尝试尝试,则环境将进入灰色状态,然后重新启动
  • I cannot redeploy any previous git commit, the env just spends 10 minutes and times out 我无法重新部署任何以前的git commit,env只是花了10分钟而超时

I'm getting frustrated having to rebuild an ENTIRE environment every time there is a slight error in the code. 每当代码中有轻微错误时,我都不得不重新构建整个环境,这让我感到沮丧。

In general, I'm looking for an alternative to heroku, from which I can deploy changes from the command line. 通常,我正在寻找heroku的替代方案,从中可以从命令行部署更改。 I don't think my question is phrased well enough for anyone to spot out exactly what I'm doing wrong - If I am even doing something wrong. 我认为我的问题的措辞不够好,任何人都无法准确地知道我在做什么-如果我什至在做错事情。 If there are any best-practices with deploying to EB.. please let me know. 如果有部署到EB的最佳实践,请告诉我。 Thanks! 谢谢!

What size instance are you using? 您正在使用什么大小的实例? I've found that trying to use a micro instance doesn't work as it runs out of memory when building any native extensions. 我发现尝试使用微实例是行不通的,因为在构建任何本机扩展时,它会耗尽内存。

Try using a t2.small instance at a minimum. 尝试至少使用一个t2.small实例。

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

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