Skip to content

Instantly share code, notes, and snippets.

@Set27
Created February 8, 2026 20:12
Show Gist options
  • Select an option

  • Save Set27/9a59b5df81f6bb15d989f55f64d38901 to your computer and use it in GitHub Desktop.

Select an option

Save Set27/9a59b5df81f6bb15d989f55f64d38901 to your computer and use it in GitHub Desktop.
Ruby 2.6.3 devenv
#!/usr/bin/env bash
export DIRENV_WARN_TIMEOUT=20s
export NIXPKGS_ALLOW_INSECURE=1
eval "$(devenv direnvrc)"
# `use devenv` supports the same options as the `devenv shell` command.
#
# To silence all output, use `--quiet`.
#
# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
use devenv --impure
{ pkgs, lib, config, inputs, ... }:
{
# https://devenv.sh/basics/
env.GREET = "devenv";
# https://devenv.sh/packages/
packages = with pkgs; [
git
libyaml
];
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
languages.ruby = {
enable = true;
version = "2.6.3";
bundler.enable = true;
# listen_addresses = "localhost";
};
# https://devenv.sh/basics/
enterShell = ''
ruby --version
'';
}
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
nixpkgs-ruby:
url: github:bobvanderlinden/nixpkgs-ruby
inputs:
nixpkgs:
follows: nixpkgs
# If you're willing to use a package that's vulnerable
permittedInsecurePackages:
- "openssl-1.1.1w"
@Set27
Copy link
Author

Set27 commented Feb 8, 2026

Error log

error: Cannot build '/nix/store/c4bg3kdahn31kxs2q3972w8wvh48xa0y-ruby-2.6.3.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/ggyxs901qq5fa8i2750snlb15gkpb1cf-ruby-2.6.3
       Last 25 log lines:
       > cc1: note: unrecognized command-line option '-Wno-constant-logical-operand' may have been intended to silence earlier diagnostics
       > At top level:
       > cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
       > cc1: note: unrecognized command-line option '-Wno-parentheses-equality' may have been intended to silence earlier diagnostics
       > cc1: note: unrecognized command-line option '-Wno-constant-logical-operand' may have been intended to silence earlier diagnostics
       > building rb_mjit_header.h
       > linking miniruby
       > rb_mjit_header.h updated
       > generating encdb.h
       > building .ext/include/x86_64-linux/rb_mjit_min_header-2.6.3.h
       > ./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "gcc " rb_mjit_header.h .ext/include/x86_64-linux/rb_mjit_min_header-2.6.3.h
       > encdb.h updated
       > error in initial header file:
       > In file included from /build/20260208-15334-17xmzqv.c:1:
       > /build/20260208-15334-12g14mu.h: In function 'vm_cref_dup':
       > /build/20260208-15334-12g14mu.h:9762:30: error: passing argument 2 of 'rb_hash_foreach' from incompatible pointer type [-Wincompatible-pointer-types]
       >  9762 |         rb_hash_foreach(ref, ref_delete_symkey, ((VALUE)RUBY_Qnil));
       >       |                              ^~~~~~~~~~~~~~~~~
       >       |                              |
       >       |                              int (*)(VALUE,  VALUE,  VALUE) {aka int (*)(long unsigned int,  long unsigned int,  long unsigned int)}
       > compilation terminated due to -Wfatal-errors.
       > make: *** [uncommon.mk:233: .ext/include/x86_64-linux/rb_mjit_min_header-2.6.3.h] Error 1
       > make: *** Waiting for unfinished jobs....
       > ./tool/ifchange "--timestamp=.rbconfig.time" rbconfig.rb rbconfig.tmp
       > rbconfig.rb updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment