ElasticBeanstalk - Rails Nokogiri Deployment Issue

混江龙づ霸主 提交于 2019-12-12 20:46:04

问题


I have a working rails application deployed to EC2 through ElasticBeanstalk. I update the website every few weeks without issue. Today I'm running into a problem after committing changes and running "eb deploy":

An error occurred while installing nokogiri (1.7.0.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before bundling.

I haven't changed anything aside from a few views. The host is the same and the Gemfile is the same. On my local machine, I can run that command and then bundle install/update without issue. I can SSH to the EC2 host and successfully run that command to install that version of Nokogiri, too.

When I deploy, I get that error message (with no other details). I'm stuck - Any idea what I should look into next? Note that this started happening to a working setup, so I don't think it's the host missing libxml or another dependency.


回答1:


Found it. There was a line in the log file that I was missing.

"Cannot allocate memory"

Rails was using a lot more memory than I thought. Just sitting there it was using 1.7GB out of 2.0GB. I temporarily added 1GB of swap and the deployment succeeded.



来源:https://stackoverflow.com/questions/41945708/elasticbeanstalk-rails-nokogiri-deployment-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!