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

Fixing a Memory-bottlenecked Rails App

July 2, 2018


On Jun 29 Nate Berkopec (@nateberkopec) tweeted this: “Observation: when scaling on AWS/AWS-based VPS services, newer, lower-volume Rails applications tend to be memory-bottlenecked, older, high-volume Rails applications tend to be cpu-bottlenecked.” This is really useful to know. We recently saw our tiny new Rails app running on an AWS t2.micro server getting into a “WARN” state after running a sucker punch job. It was using over 90% of its RAM, and stayed that way until we restarted the server. ... Read more

Minimal Email Receiving

May 1, 2018


How we receive email for our domain using email forwarding on Amazon SES, with minimum effort. Our web-app sends emails no problem, but we also want to receive emails into the same accounts. For example our web-app sends an automatic email from info@mySite.com, but if it receives an email sent to info@mySite.com, we want to handle that too. The simplest way is to implement email forwarding. (The hard way would be to build an email client inside our web-app, then decide how and when to notify whoever needs to handle it). ... Read more

Rails 5.2: encrypted secrets

March 22, 2018


How we started to use Rails 5.2 Encrypted Secrets for securing Amazon S3 key pairs for use with Active Storage. Here is a useful starting point: Rails Encrypted Credentials on Rails 5.2 Our development and production envionment is Linux, and we precompile our assets before deployment. Part 1: Encrypt your secrets With Rails 5.2 a sort of ‘password safe’ is introduced, whereby you commit your encrypted secret credentials to source control, but not your master password. ... Read more

Rails 5 tutorial chat app - can we deploy it to AWS?

December 30, 2015


The simple chat example that DHH built in his recent screencast using ActionCable in Rails 5, is available on GitHub here: https://github.com/HectorPerez/chat-in-rails5. But can we get this working on an Elastic Beanstalk single instance - with no load balancer ? => Initially yes, then no, then yes! On a development pc:Action Cable works with redis so to run the chat app you will need to install redis on your local machine: ... 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

Scaling down to single instance Elastic Beanstalk.

April 13, 2015


When you are looking to reduce your AWS costs, you might consider removing the Load balancer. At $20 per month it accounts for a large proportion of the hosting costs for a small application. Is it really needed right now? Down the line when your application grows, you can easily bring it back - right? Elastic beanstalk is handy for provisioning and deployment, and thankfully the load balancer is not compulsory. ... 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

© 2020 Keith P | Follow on Twitter | Git