“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust.
I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it
Currently working for GenieBelt who are based in Copenhagen, Denmark ...”
This is annoying, especially when it comes to specs. What really matters is here is ensuring that our datetime fields have the correct precision that we need for our purposes. Which could be 6 or 9.
What with everything going on recently, and don’t get me wrong they are exciting things, I didn’t get round to buying a COPENHELL ticket and it will the first year in 8 that I won’t be going. No really. I’ll write code for a ticket. And. Yes Pustulant Flesh ate my dog’s homework
As per usual native extensions don’t always install 1st time. Damn…
bundle add ruby-libgd
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Fetching ruby-libgd 0.1.9
Installing ruby-libgd 0.1.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
The error is right there.
gem install ruby-libgd
Building native extensions. This could take a while...
ERROR: Error installing ruby-libgd:
ERROR: Failed to build gem native extension.
current directory: /Users/rl/.asdf/installs/ruby/3.4.6/lib/ruby/gems/3.4.0/gems/ruby-libgd-0.1.9/ext/gd
/Users/rl/.asdf/installs/ruby/3.4.6/bin/ruby extconf.rb
checking for -lgd... no
libgd not found
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/rl/.asdf/installs/ruby/3.4.6/lib/ruby/gems/3.4.0/extensions/arm64-darwin-24/3.4.0/ruby-libgd-0.1.9/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/rl/.asdf/installs/ruby/3.4.6/lib/ruby/gems/3.4.0/gems/ruby-libgd-0.1.9 for inspection.
Looks like libgd is already installed.
brew install libgd
==> Auto-updating Homebrew...
Adjust how often this is run with `$HOMEBREW_AUTO_UPDATE_SECS` or disable with
`$HOMEBREW_NO_AUTO_UPDATE=1`. Hide these hints with `$HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
==> Downloading https://ghcr.io/v2/homebrew/core/portable-ruby/blobs/sha256:1c98fa49eacc935640a6f8e10a2bf33f14cfc276804b71ddb658ea45ba99d167
##################################################################################################################################################################################### 100.0%
==> Pouring portable-ruby-3.4.8.arm64_big_sur.bottle.tar.gz
==> Auto-updated Homebrew!
Updated 4 taps (heroku/brew, mongodb/brew, homebrew/core and homebrew/cask).
---8<----
You have 125 outdated formulae and 2 outdated casks installed.
Warning: gd 2.3.3_6 is already installed and up-to-date.
To reinstall 2.3.3_6, run:
brew reinstall gd
So I need to include the path the native libraries when installing.
rl@loathsome fossa % bundle install
Bundle complete! 24 Gemfile dependencies, 125 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
Run `bundle fund` for details
Old blog posts I never published, except I have now #12
Say we wanted to schedule a job but wanted to limit duplicate jobs running within a specific time period. We could set a time for a job to run and ignore duplicate requests in our queue. It appears Ruby’s Time object makes this simple for us. We can round up (or floor) to the nearest, time interval. Nice.
rl@macbookair personal % asdf plugin update ruby
Location of ruby plugin: /Users/rl/.asdf/plugins/ruby
Updating ruby to master
From https://github.com/asdf-vm/asdf-ruby
1ce84e2..8f28d3a master -> master
1ce84e2..8f28d3a master -> origin/master
Already on 'master'
Your branch is up to date with 'origin/master'.
rl@macbookair personal % asdf install ruby 4.0.0-preview2
ruby-build: using openssl@3 from homebrew
==> Downloading ruby-4.0.0-preview2.tar.gz...
-> curl -q -fL -o ruby-4.0.0-preview2.tar.gz https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.0-preview2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22.3M 100 22.3M 0 0 17.5M 0 0:00:01 0:00:01 --:--:-- 17.5M
==> Installing ruby-4.0.0-preview2...
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.asdf/installs/ruby/4.0.0-preview2" --with-openssl-dir=/opt/homebrew/opt/openssl@3 --enable-shared --with-libyaml-dir=/opt/homebrew/opt/libyaml --with-gmp-dir=/opt/homebrew/opt/gmp --with-ext=openssl,psych,+ --enable-yjit
It’s not uncommon for Rails specs to kill our database in development. It appears that if a browser spec doesn’t close cleanly you can end up with processes just hanging and so the next spec run will just wait forever.
Here’s the process list. It’s sleeping on the job.
Old blog posts I never published, except I have now #9
I, [2015-01-22T07:15:59.225481 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.0ms)
I, [2015-01-22T07:15:59.225700 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.0ms)
I, [2015-01-22T07:15:59.225951 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.1ms)
I, [2015-01-22T07:16:00.561068 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (1307.7ms)
I, [2015-01-22T07:16:00.561527 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.1ms)
I, [2015-01-22T07:16:00.561772 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.1ms)
I, [2015-01-22T07:16:00.561993 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.1ms)
I, [2015-01-22T07:16:00.562210 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.0ms)
I, [2015-01-22T07:16:00.562425 #30041] INFO -- : Rendered api/characters/_character.json.jbuilder (0.1ms)