0

I'm using Elastic Beanstalk to deploy ruby on rails application to aws. im following the instruction on this website.

Deploying a Rails Application to Elastic Beanstalk

but WHEN i get to step to deploy the application i get an error

enter image description here

This image from eb-activity.log enter image description here

enter image description here

gem 'jquery-rails'
gem 'rails', '~> 5.1.4'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'therubyracer', platforms: :ruby
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'redis', '~> 3.0'
gem 'bcrypt', '~> 3.1.7'
gem 'capistrano-rails', group: :development

group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end

group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'bootstrap-sass', '~> 3.3.7'
gem 'devise', '~>4.2'
gem 'toastr-rails', '~> 1.0'
gem 'omniauth', '~> 1.6'
gem 'omniauth-facebook', '~> 4.0'
gem 'paperclip', '~>5.1.0'
gem 'aws-sdk','~> 2.8'
gem 'geocoder', '~> 1.4'
gem 'jquery-ui-rails', '~> 5.0'
gem 'ransack', '~> 1.7'
gem 'twilio-ruby', '~> 4.11.1'
gem 'fullcalendar-rails', '~> 3.4.0'
gem 'momentjs-rails', '~> 2.17.1'
gem 'stripe', '~> 3.0.0'
gem 'rails-assets-card', source: 'https://rails-assets.org'
gem 'omniauth-stripe-connect', '~> 2.10.0'
gem 'chartkick', '~> 2.2.4'
gem 'mysql2', '~> 0.3.18'
gem 'yaml_db'
gem 'vider'
gem 'nokogiri', '1.8.1'

enter image description here

6
  • make sure bundle install in localhost and is't puma or passenger server ? Commented Jun 24, 2018 at 19:49
  • @7urkm3n yes I have bundle install inside my folder directory, im using gem 'puma', '~> 3.7' Commented Jun 24, 2018 at 20:15
  • what about EB, is Puma or Passenger ? make sure to choose Puma 2.4. also can u post gemfile Commented Jun 24, 2018 at 20:21
  • @7urkm3n I did add gemfile to the question . for the EB it cant be changed to puma in the console and by default it sets to Passenger. i create new environment using eb cli I select Puma 2.4 then I run through error, i have image of the error edit to the question and I followed this link Commented Jun 24, 2018 at 21:18
  • @7urkm3n here is the link . stackoverflow.com/questions/40938155/… Commented Jun 24, 2018 at 21:21

1 Answer 1

1

The relevant error is:

Installing nokogiri 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

nokogiri 1.8.1 has security vulnerabilities so it is a very good idea to upgrade to the latest version, which is 1.8.3. This also might have the side effect of fixing the build error you are seeing, so it is worth a shot.

On your development machine, upgrade nokogiri like this:

bundle update --conservative nokogiri

Then commit the Gemfile.lock, push and redeploy.

If that still doesn't work, you may simply not have enough memory on the server to compile the nokogiri extensions. See this question: ElasticBeanstalk - Rails Nokogiri Deployment Issue

Or search for "nokogiri elastic beanstalk" for more answers: https://stackoverflow.com/search?q=nokogiri+elastic+beanstalk

Sign up to request clarification or add additional context in comments.

1 Comment

I believe @Matt Brictson has the right answer - the Cannot allocate memory error in eb-activity.log indicates that your instance is too small. Try using a bigger instance (along with the latest version of Nokogiri) and the problem should go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.