I Must Be Doing It Wrong

I’ve started this post several times, and still can’t figure out a clear path. I feel frustrated with the situation, and I don’t know enough to be able to make progress. Sometimes, writing a blog post helps me organize my thoughts so that I can see a way forward. So far, no luck. Once more, with feeling!

The Goal: learn to use Ruby and Rails.

Why: I would like to help an organization by working on software to solve their problems. To do that, I need to be familiar with the tools.

 

First attempt: install rails on my laptop (which already has Ruby).

Outcome: gem install rails seems to work, but later on rails new demo barfs errors from puma. Puma, in turn, is complaining about some missing symbol: _SSL_get1_peer_certificate.

Second attempt: assuming that my Ruby is too down-rev, and maybe my OpenSSL is as well, try installing newer versions of both.

Outcome: `brew upgrade openssl` followed by `rbenv install 3.1.1` fails during compilation of Ruby. Despite having a shiny fresh openssl, ruby-build still downloads openssl 1.1.1n and builds against that. Also, ruby-build is pig-headed enough to insist on using a version of readline that causes compilation to fail. `brew upgrade readline` declares that version 8.1.2 is already installed, and ruby-build declares that it’s using readline from homebrew, and compilation of ruby fails in ossl_engine.c, bitching about readline.c, complaining about an undeclared identifier. Clearly, these kids are not talking to each other.

Third attempt: download ruby 3.1.1 as a tarball and make it manually, just to see what happens.

Outcome: This configures and builds just fine. No bitching about missing openssl, no problems with readline, everything is great. Only now, how do I install this so that it doesn’t stomp all over the existing ruby, either the system or the 2.7.2 that rbenv has, so that the things that currently use Ruby and which currently work continue to work? I can’t find any documentation that will tell me how to do that, and a cursory look at the make file doesn’t reveal something so helpful and obvious as INSTALL_BASE_DIR or anything.

Fourth attempt: my friend who does Ruby development (on purpose!) for a living says he uses Docker for all this stuff. This makes all kinds of sense. Let’s try that.

Outcome: Using Alpine as the base for my development image causes all kinds of problems — it’s too thin. Try again, but this time start with an image that’s full of stuff that we already need. I started with a node based on Ubuntu, and that seems to be good. Ruby 3.1.1 builds and installs, rails 7.0.2.3 installs, gems install fine, w00t, it all seems to work! Except. Sure, this manages to get rails installed and working in a place, and I can mount a source folder on my laptop into the container so that when I kill the container I keep the source, but I still need to learn Ruby and I still need to learn Rails. I think that my two days of arguing with Docker and Visual Studio Code should get their own post.

Published by pirateguillermo

I play the bagpipes. I program computers. I support my family in their various endeavors, and I enjoy my wonderful life.

Leave a Reply Cancel reply