DEV Community

olistik
olistik

Posted on

Compiling Ruby 3.3 on OpenBSD 7.4

Resuming the work done for

https://dev.to/olistik/a-naive-installation-of-ruby-and-rails-on-openbsd-4d50

I wanted to test the latest Ruby 3.3.0 on the latest OpenBSD 7.4 and here are the results.

First of all, let's download the sources:

$ curl -LO https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
$ tar xvfz ruby-3.3.0.tar.gz
$ cd ruby-3.3.0
Enter fullscreen mode Exit fullscreen mode

Add libyaml dependency if you don't have it already:

$ doas pkg_add libyaml
Enter fullscreen mode Exit fullscreen mode

Configure the compilation so that it picks libyaml and it outputs the binaries in our rubies directory:

$ CONFIGURE_ARGS="--with-libyaml-dir=/usr/local/lib" ./configure  --prefix ~/.rubies/3.3.0
$ make
$ make install
Enter fullscreen mode Exit fullscreen mode

Update the symlink for the current version:

$ cd $HOME/rubies
$ rm current
$ ln -s /home/$HOME/.rubies/3.3.0/ current
Enter fullscreen mode Exit fullscreen mode

And then check if everything works as expected:

$ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-openbsd7.4]
Enter fullscreen mode Exit fullscreen mode

Top comments (0)