Skip to content

Instantly share code, notes, and snippets.

@shubhamkumar13
Created April 29, 2026 10:29
Show Gist options
  • Select an option

  • Save shubhamkumar13/4da4e99efff1b842d31d579c69af2a8d to your computer and use it in GitHub Desktop.

Select an option

Save shubhamkumar13/4da4e99efff1b842d31d579c69af2a8d to your computer and use it in GitHub Desktop.
when my g++ or make fails to compile with rebar

Here's the Fish shell equivalent of the recommended fix from #1:

1. Add the directory to PATH (temporarily, for current session)

set -gx PATH /home/linuxbrew/.linuxbrew/bin $PATH

2. Set CC and CXX to just the compiler names (not absolute paths)

set -gx CC gcc-15
set -gx CXX g++-15

3. Unset any previously absolute‑path versions (if you had them)

set -e CC
set -e CXX
set -e MAKE   # also clear MAKE to be safe

To make these changes permanent

Add the set -gx lines (except the set -e ones) to your Fish config file:

echo 'set -gx PATH /home/linuxbrew/.linuxbrew/bin $PATH' >> ~/.config/fish/config.fish
echo 'set -gx CC gcc-15' >> ~/.config/fish/config.fish
echo 'set -gx CXX g++-15' >> ~/.config/fish/config.fish

After running the above, retry your build with:

cd /var/home/sk/hexdocs_offline
rm -rf _build deps
rebar3 compile

Note: In Fish, set -gx means global (persists within the shell session) and export (available to child processes).
To add a directory to PATH without duplicates, consider using fish_add_path /home/linuxbrew/.linuxbrew/bin (Fish 3.2+).

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