Skip to content
New issue

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

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

Already on GitHub? # to your account

remote command doesn't find my executable (after upgrade from 0.3 to 1.0) #513

Closed
jmuheim opened this issue Feb 1, 2017 · 4 comments
Closed

Comments

@jmuheim
Copy link

jmuheim commented Feb 1, 2017

I have the following custom task:

desc "Performs a backup."
task backup: :environment do
  comment 'Performing backup'
  command %{backup perform --trigger=audit}
end

It gives the following error:

$ mina backup
-----> Performing backup
       bash: line 1: backup: command not found
       Connection to zugangfueralle01.nine.ch closed.

 !     Run Error

But when manually ssh'ing to the server and executing $ backup perform --trigger=audit, it works well.

Does remote miss some configuration which is loaded when ssh'ing manually?

Interestingly, this very same task worked perfectly in v0.3, but after upgrading to 1.0, it doesn't anymore

@jmuheim
Copy link
Author

jmuheim commented Feb 2, 2017

@jmuheim jmuheim changed the title remote command doesn't find my executable remote command doesn't find my executable (after upgrade from 0.3 to 1.0) Feb 8, 2017
@jmuheim
Copy link
Author

jmuheim commented Feb 8, 2017

I found a workaround, just load the env manually in the environment:

task :environment do
  command %{source $HOME/.bash_profile; source $HOME/.bashrc;}
end

But why isn't this done automatically anymore?

@d4be4st
Copy link
Member

d4be4st commented Sep 8, 2017

This is because how your bash_profile is written

There is a line on the top:

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

which exits bash rc and does not go to the end, and i assume your program is sources at the end of your bashrc file

@jmuheim
Copy link
Author

jmuheim commented Sep 16, 2019

Just wanted to mention that it now works. I don't know, maybe a gem version update, or a change on the server side...

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

No branches or pull requests

2 participants