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

PATH is incorrect when trying to execute tests #2118

Closed
carlosgaldino opened this issue Jun 25, 2015 · 11 comments
Closed

PATH is incorrect when trying to execute tests #2118

carlosgaldino opened this issue Jun 25, 2015 · 11 comments

Comments

@carlosgaldino
Copy link
Contributor

Hi,

whenever I try to execute tests using SPC m t t for a rails project I get an error that some gems are not installed. I checked if the gems are installed on the command line and everything works well, another strange thing is that when I execute SPC m b i to install the gems I get an output saying that everything is already installed as well.

What's wrong then that when executing the specs such gems are not found?

I'm running Spacemacs version 0.102.2

Thanks.

@d12frosted
Copy link
Collaborator

@carlosgaldino try to run (getenv "PATH") and see if it returns right value (compare it to $ env | grep "PATH").

@co-dh
Copy link

co-dh commented Dec 1, 2015

I have the same bug. PATH is not inherited when started from a sshed -X ( x forward) terminal.
However, PATH is correct with emacs -nw.

@d12frosted
Copy link
Collaborator

@co-dh well, I suspect that it's not related to original issue (and honestly believe that it can be closed). But in any case, could you please describe repro steps better? Are you just doing following steps?

  1. ssh -X user@node
  2. emacs -nw
  3. notice that `(getenv "PATH") is wrong?

I am not sure how it even supposed to work (never used ssh -X).

Also, as an option you could use TRAMP (built-in emacs) to edit files over ssh.

@co-dh
Copy link

co-dh commented Dec 1, 2015

  • ssh -XA user@node
  • export PATH=foo:$PATH
  • install spacemacs there (evil mode)
  • echo $PATH, I have FOO:...
  • emacs -nw
  • :! echo $PATH , gives the same( correct) PATH
  • emacs ( no -nw, so GUI version)
  • :! echo $PATH (you will find foo is missing)

ssh -X will forward X, so the gui starts locally.
-A is not necessary for this test. It forward your ssh password.

I don't want to use TRAMP, because I would like to install/config spacemacs on the dev machine once, then ssh from everywhere.

I suspect that this bug is the same as #2118.

@StreakyCobra
Copy link
Contributor

There is the package exec-path-from-shell that try to set the $PATH accordingly to your shell configuration. For this you can not just export PATH…, you have to define in in your .bashrc or .zshrc* . You can try this, it may work better.

* if you want to do it right it should be in your .bash_profile or .zshenv, see purcell/exec-path-from-shell#34

@co-dh
Copy link

co-dh commented Dec 1, 2015

@StreakyCobra I can not set the .bashrc or .zshrc, because there is a very old version of node.js used by my production environment. so I usually just manually export before I developing.
Right now my workaround is call (setenv "PATH ..) in dotspacemacs/user-init

@StreakyCobra
Copy link
Contributor

You have a really unusual setup (ssh + X forward + emacs GUI + no .bashrc/.zshrc PATH), so I suppose there is no better way than manually setting it up in dotspacemacs/user-init. As it's a really special setup and the workaround is acceptable, there will probably not be more support than what you are doing now.

@co-dh
Copy link

co-dh commented Dec 1, 2015

I don't agree.
First, I just test with local spacemacs, the bug exist, so nothing related to X forward.
Second emacs -nw don't have this bug
Third emacs -Q (bar metal emacs UI) don't have this bug.
and my working environment is typical if you have to develop on a dev server which need to be the same as a production server.

@StreakyCobra
Copy link
Contributor

Fine, we already have more information here. I'm pretty sure if you exclude exec-path-from-shell by adding it to the dotspacemacs-excluded-packages in your .spacemacs it will work as you want.

@StreakyCobra
Copy link
Contributor

This old issue (the original one) has been waiting for a response for more than one month. As no answer has been provided, we can not help further or know if the issue is still relevant. We are then closing it. Feel free to open a new issue if there is any news on this side, be sure to read this guide first and link this issue in the new one.

@co-dh If your issue is not sloved, please open a new one.

@co-dh
Copy link

co-dh commented Dec 23, 2015

@StreakyCobra thanks. I've fixed by put it in dotspacemacs/user-init. hope this will help others.

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

No branches or pull requests

5 participants