I needed to make a small change to my hobby Rails app I was maintaining since 2009. Web development is easy, so how hard could it be?
Famous last words, as it turns out. (thread)
It turns out that, in the meantime, Facebook disallowed OAuth redirects to `http:` callback URLs. I need to update the callback to `https:`, but there is one problem— my site isn't SSL-enabled. So now I'm setting up Let's Encrypt certificates in my server's nginx configuration.
I want to start up the web app locally so I can test it out under HTTPS, but my local nginx server does not support SSL either. Now I'm studying how to generate a trusted root CA that I can use to sign other certificates for my individual localhost sites.
Does it finally work? I can't tell, because my application won't boot. I don't have the appropriate Ruby version installed, so I try to compile it and that fails because it's too old to compile on my macOS. Now I have to upgrade Ruby in my app.
After I upgrade Ruby, Bundler fails due to incompatible gems. I have to upgrade Rails as well, which requires numerous changes to my app's configuration, asset pipeline, and the test suite. I play trial-and-error with different incantations of version constraints in the Gemfile.
Now my server needs the updated Ruby version, but that doesn't compile either because my server is too old. So now I'm upgrading Ubuntu.
After that, my MongoDB database doesn't start because it skipped a major version and thus can't upgrade its database files on disk.
So before I can transition my database to mongod 3.6, I need to install 3.4 for an incremental upgrade path. Sounds clear enough, but after I configure apt package sources according to docs, it turns out that mongodb-server 3.4 isn't available anymore for my Ubuntu version.
I manage to install MongoDB 3.4 by configuring their PPA to install packages for the previous version of Ubuntu and that somehow works. I try to deploy my app, but it crashes at asset compilation phase. Newer Rails 👉 more memory 👉 my server instance has exhausted all RAM.
Now I'm resizing my DigitalOcean droplet, but upon reboot, my webapp doesn't properly come online anymore. Upon inspecting my old SysV init scripts, it seems that Ubuntu migrated part of that system to something called Upstart. I have to tweak my old service scripts by hand.
Now my server is booting ♻️
the web app is starting 🚀
SSL certificates are certificating 🔐
the database is migrating 📦
the stylesheets are cascading 💅
…but I can't remember anymore why I was doing any this in the first place
You can follow @mislav.
Tip: mention @threader_app on a Twitter thread with the keyword “compile” to get a link to it.
Enjoy Threader? Sign up.
Since you’re here...
... we’re asking visitors like you to make a contribution to support this independent project. In these uncertain times, access to information is vital. Threader gets 1,000,000+ visits a month and our iOS Twitter client was featured as an App of the Day by Apple. Your financial support will help two developers to keep working on this app. Everyone’s contribution, big or small, is so valuable. Support Threader by becoming premium or by donating on PayPal. Thank you.