Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with rvm #31

Open
davidw opened this issue Jun 4, 2019 · 1 comment
Open

Problem with rvm #31

davidw opened this issue Jun 4, 2019 · 1 comment

Comments

@davidw
Copy link

davidw commented Jun 4, 2019

-*- mode: compilation; default-directory: "~/workshop/xxxxxxxyyyyyyyyyzzzzzzzz/" -*-
Compilation started at Tue Jun  4 09:39:33

bundle exec rubocop --format emacs /home/davidw/workshop/xxxxxxxyyyyyyyyyzzzzzzzz/
/bin/bash: bundle: command not found

That is from an emacs I had running.

If I start an Emacs in the project directory, and run things, it all seems to work well.

@uri-t
Copy link

uri-t commented Mar 8, 2021

I think this is because the compilation mode runs in a non-login shell so the rvm hooks etc. don't load. I'm not sure if there's a way to have it run as a login shell, but I was able to get around this by manually loading the profiles script (see below: without the source .. part it gave the wrong ruby binaries, but with it included it gave the right ones).

(defun rvm-load-example()
  (interactive)
  (compilation-start "source /etc/profile.d/rvm.sh && cd [project path] && which ruby")
)

You might be able to get it working by adding something like (concat "source /etc/profile.d/rvm.sh && " ... in the rubocop-build-command function, but I'm not exactly sure how to make this also work for non-rvm users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants