reddit / emacs

How to add repository dependencies for Magit?

Two_Souls · 2022-06-24 05:47
I have a rails project with Overcommit gem that runs as a hook on git commit. This works fine in the command line as Overcommit has been installed (homebrew, rbenv, gem install overcommit). But when I commit through Magit it complains: This repository contains hooks installed by Overcommit, but the `overcommit` gem is not installed. Install it with `gem install overcommit`. The normal process here on OSX at least is to install Homebrew so that you can install Rbenv so that you can control the Ruby version which overrides the base operating system version of Ruby. And then you can install the gem. How can I run through this process for Magit? Or How can I install a dependency such as this in the shell that Magit uses? ​ I tried running through the process of installing Homebrew etc using the *magit-shell-command* but I get this message and cannot proceed: run /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ==> Checking for `sudo` access (which may request your password)... Password: ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew  Press RETURN/ENTER to continue or any other key to abort: Can anyone point me in the right direction?
Two_Souls · 2022-06-24 05:49
Or could I set Magit/Emacs to use my Zshell?
gogo-bog · 2022-06-24 07:10
This is a common problem with macos and Emacs, you can add ‘exec-path-from-shell’ plugin to fix this. In case you are using doom it’s ‘~/.emacs.d/bin/doom sync’
Mikardo · 2022-06-24 09:20
You can try vterm (emacs-libvterm), it works with zsh
ir210 · 2022-06-25 21:37
Or if you're using spacemacs, put all relevant environment variables in the ~/.spacemacs.env
Two_Souls · 2022-06-28 00:32
Thanks for the suggestion. I will try this. No doom, just my own custom config but I only started on Emacs last week!
Two_Souls · 2022-06-28 00:32
Interesting. I'll check it out. Many thanks.
Thaodan · 2022-07-08 22:53
Emacs uses which ever shell you have set for your user.
Two_Souls · 2022-07-09 02:13
Please elaborate?
Thaodan · 2022-07-09 02:21
Emacs uses the login shell for your user typically found as \`$SHELL\`.
Two_Souls · 2022-07-09 06:08
I clocked the issue and was able to resolve by running Emacs directly from the terminal.