How We Moved Rails Development to Windows WSL2 Linux

July 29, 2020


Up till now we had been developing Rails 6 applications on linux using VMWare on a windows laptop. But now with the general availability of WSL 2, we can retire the old laptop and do everything together in one place. Given that WSL 2 does not currently support GUI applications, we cant expect to replicate the Pepermint distro that was so nice to use. Instead we are taking the opportunity to retool to use VS codeOur toolset uncludes “Git”, “Rails”, “PostgreSQL”, and deployment to “AWS Beanstalk” ... Read more

Upgrading to Rails 5.0.0.beta1

December 21, 2015


What we did to upgrade a small Rails app from Rails 4.2.5 to Rails 5.0.0.beta1. Now the upgrade is deployed in AWS, here is where we are at: When deploying, remember to change the secret key base to invalidate all sessions. ( or your users will get a nasty 500 error ) Temporarily removed NewRelic from the gemfile – it doesn’t currently support Rails 5.0.0.beta1. (UPDATE: as of 11 Feb NewRelic supports Rails 5. ... Read more

Rails 4.2.1 upgrade ( SMTP email sending fail)

March 27, 2015


Soon after we updated to Rails 4.2.1 from 4.2.0 deployed - the site stopped respondingand we saw this error in the passenger log: phusion_passenger/preloader_shared_helpers.rb:69:in `fork': Cannot allocate memory - fork That was also the last time emails were successfully sent from Elastic Beanstalk. Now SMPT emails are silently failingwith no clues in the logs. We were unsure if the memory issue was with this AWS instance or this update. Later decided it was the instance. ... Read more

Moving Rails development from Windows to Linux

February 23, 2015


Recently we embarked on a new feature requiring a gem that is not compatible with Windows. see also: [Moving Rails Development to Windows WSL 2 Linux] (/post/moving-rails-development-to-windows-wsl2-linux/). To re-quote a quote from https://meta.discourse.org/t/bundle-install-fails-on-windows/6494 : “The reality is that Ruby, as used by most Rails apps is full of unixism, performance of Ruby MRI (the default Ruby) on Windows is abysmal, Rails load times are hellish, sooner or later (more likely sooner) you are going to hit gems that simply do not work properly on Windows. ... 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

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

Speeding up Ruby on Rails

August 19, 2014


…with less sql queriesA Rails application will make a large number of sql queries per page unless steps are taken to mitigate this. This is bad because it degrades the performance of your app, affects your ability to scale, and will cost you money. Install the New Relic gem to see the sql queries made when loading a page in your app. Here is what we changed to reduce the number of sql queries per page: ... Read more

Eager loading and pg_search: good bye to polymorphic association.

August 11, 2014


When we first designed the database schema for our Rails project, we employed the ‘Single Table Inheritance’ and ‘Polymorphic Associations’ strategies to two different and deserving cases. For the latter case, we needed to model different types of a class having common properties as well as unique. So for this, Polymorphic Association was chosen over Single Table Inheritance to achieve a cleaner data structure ( with less holes ). Since then, the project has evolved and undergone several performance enhancement iterations, and today we decided it was time to lose the polymorphic association at the center of an n + 1 performance problem. ... 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

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

© 2020 Keith P | Follow on Twitter | Git