Skip to content

gem install pg: fatal error: libpq-fe.h: No such file or directory #2430

@MartinElvar

Description

@MartinElvar

What happened?

I'm trying to setup my rails project, it works perfectly fine with a normal nix-shell, but not with dev box

I'm getting, even tho postgresql is installed.

-I/nix/store/vpaj7w9aif0gbfs2bfpvav8a2026wkam-ruby-3.3.5/include/ruby-3.3.0 -I. "-IThe real pg_config can be found in the -dev output." -O3 -fPIC -c conftest.c"
conftest.c:3:10: fatal error: libpq-fe.h: No such file or directory

Steps to reproduce

  1. gem install pg

Command

No response

devbox.json

{
  "packages": {
    "ruby":       "3.3",
    "bundler":    "2.5",
    "nodejs":     "21",
    "yarn":       "1.22",
    "curl":       "latest",
    "sqlite":     "latest",
    "postgresql": "latest",
    "nix-ld":     "latest"
  },
  "shell": {
    "init_hook": [
      "gem install rails -v 7.2",
      "./blog/bin/bundle install",
      "./blog/bin/rails -f ./blog/Rakefile db:prepare"
    ],
    "scripts": {
      "run_test":     ["./blog/bin/rails test"],
      "start_server": ["./blog/bin/rails server"]
    }
  }
}

Devbox version

0.13.6

Nix version

unstable nixos

What system does this bug occur on?

Linux (x86-64)

Debug logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions