Amer Bearat
Amer Bearat

Reputation: 946

deploy ruby on rails to aws using Elastic Beanstalk error

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

Upvotes: 0

Views: 635

Answers (1)

Matt Brictson
Matt Brictson

Reputation: 11102

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

Upvotes: 1

Related Questions