Configuring HTTPS for the AWS Elastic Beanstalk Load balancer

January 19, 2015


Switching your Rails site to always use HTTPS takes a bit configuring. Here is how we followed AWS’s 3 high level steps: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html Create a custom domain with your DNS provider. Create and upload an SSL certificate to AWS Identity and Access Management (AWS IAM). Update your Elastic Beanstalk environment to use HTTPS. Step 1) was DONE - We already had our own www.ourdomain.com, not registered on AWS route 53 nor using the AWS route 53 name servers, but with godaddy. ... Read more

Upgrading to Ruby 2.1.4, from 1.9.3

January 2, 2015


Now that Rails 4.2.0 is out and several things have aligned, we took the plunge to upgrade to Ruby 2.1.4 from 1.9.3. We had already upgraded to Rails 4.2.0. Upgrading ruby was fairly straightforward, and we improved the AWS deployment in the process: faster updates & DB no longer tied to EB. Here are the steps we took: The plan was to create a whole new AWS EB environment using the latest 2014. ... Read more

Background processing on the cheap.

October 27, 2014


We recently upgraded to Rails 4.2.0.beta2 to take advantage of the new Active Job framework and other improvements. We chose Sucker Punch to avoid the cost of using a separate worker on Elastic Beanstalk, along with Fist Of Fury for scheduling ( which we ended up not using ). So we introduced active jobs to spawn threads for anything that takes time, like emails, external API calls, and heavy DB processing. ... Read more

Upgrading to Rails 4.2.0.beta2 ( aka upgrading to rspec-rails 3.1.x )

October 21, 2014


Here is the process we went through to get our tests passing after upgrading our Rails app from Rails 4.1 to Rails 4.2.0.beta2. We updated the rails gem version and ran bundle update, and found these gems needed to be upgraded to resolve dependencies: gem 'rspec-rails', '~> 2.14.1' upgraded to '~> 3.1.0' gem 'rspec', '~> 2.14.1' upgraded to '~> 3.1.0' gem 'sass-rails', '>= 3.2' upgraded to '>= 5.0.0.beta1' gem 'bootstrap-sass', '~> 3. ... Read more

Deploying versions with zero downtime ( 2 months later )

October 7, 2014


Again, two months, almost to the day since we last hit problems with deployment, we are here again. Up till the day before, deployments worked fine if a little slow, but now they fail with a timeout. The site is running okay but remains at that version: The process is now faultless: “Deploying Versions with Zero Downtime”. Here is what we did: STEP 1) Take a DB snapshot. STEP 2) Duplicate the environment in AWS management console, using the DB snapshot just created. ... Read more

Deploying versions with zero downtime

July 24, 2014


Two months, almost to the day since we last hit problems with deployment, it looks like we are here again. Up till the day before, deployments worked fine if a little slow, but now they fail with a timeout. The site is running okay but remains at that version: It is not possible to retrieve the logs - also due to an execution timeout. It is possible to SSH to the EC2 server but looking around the logs it appears everything is rolled back. ... Read more

Bootstrap-sass upgrade for Rails on AWS

June 5, 2014


We recently spent a little time replacing blueprint with twitter bootstrap - precompiled with sass. It looks great. When it came to deploying to Elastic Beanstalk, we hit a few unexpected issues. Here is what we did to get it working. We are running on the 64bit Amazon Linux 2014.03 AMI. The up to then prerequisite nokogiri v 1.6.1 gem was already installed and working fine. The problem came with bundle install requiring nokogiri v 1. ... Read more

Adventures in creating a new AWS EB environment

May 21, 2014


We added queue classic to our Rails 4.1 + PostgreSQL application running on the AWS EB free tier. Then we hit problems. Later deployments failed (10 min time-out) yet the website continued to work okay. The cause could have been the QC worker rake task, additional gems or maybe a combination of the two. So we tried restarting the app server => failed (10 min time-out). Then we tried rebuilding the whole EB environment => failed to remove a security group due to dependencies. ... Read more

Rails 4.1 upgrade from 4.0

April 16, 2014


We have just upgraded a rails 4.0 application to Rails 4.1. It has a PostgreSQL DB; is developed on Windows; and is run in production on Linux in AWS. All rspec tests were passing and on rails 4.0 prior to the upgrade. On setting the rails version to 4.1, we had some test failures. Here are the fixes made: Timezone error: C:/Ruby193/lib/ruby/gems/1.9.1/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:199:i n `rescue in create_default_data_source': No timezone data source could be found. ... Read more

© 2020 Keith P | Follow on Twitter | Git