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

Guard won't start (when installed via Package Control) #11

Closed
ticktricktrack opened this Issue Feb 6, 2012 · 21 comments

Comments

Projects
None yet
5 participants
@ticktricktrack

Bundle exec guard runs fine, however, with "Start Guard" from Sublime I won't get any output at all, not even errors. The window just stays empty. When I start guard, the output window won't open automatically, however I can open it by using cmd+shift+c.

OS X fully updated
ruby 1.9.3 in an rvm gemset
guard 1.0.0
Sublime Text 2 Beta, Build 2165

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 6, 2012

Owner

Have you tried quitting Sublime Text 2 and starting it up again. Once you have started it again try to Start Guard and see if it works correctly. I suggest this only because I have gotten reports from a few people that they have had similar issues after installing and they have gone away once they restarted Sublime Text 2.

Owner

cyphactor commented Feb 6, 2012

Have you tried quitting Sublime Text 2 and starting it up again. Once you have started it again try to Start Guard and see if it works correctly. I suggest this only because I have gotten reports from a few people that they have had similar issues after installing and they have gone away once they restarted Sublime Text 2.

@ticktricktrack

This comment has been minimized.

Show comment
Hide comment
@ticktricktrack

ticktricktrack Feb 7, 2012

Sorry, no luck. And I have no idea how to get you some meaningful debug output.

Sorry, no luck. And I have no idea how to get you some meaningful debug output.

@metakeule

This comment has been minimized.

Show comment
Hide comment
@metakeule

metakeule Feb 7, 2012

me too:

Ubuntu, Sublime Text 2 Beta, Build 2165, guard 0.4.0 (works with and without bundle exec), ruby 1.9.2

me too:

Ubuntu, Sublime Text 2 Beta, Build 2165, guard 0.4.0 (works with and without bundle exec), ruby 1.9.2

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 8, 2012

Owner

@ticktricktrack I just upgraded one of my apps to use guard 1.0.0 and I am having no problem with it. I am on the following:

OS X fully updated
ruby 1.9.3 in an rvm gemset
guard 1.0.0
Sublime Text 2 Dev Builds, Build 2175 (I used to use 2165 and it worked with my plugin)

To help figure out what is going on exactly I recommend that you run "Start Guard" from Sublime Text 2 and then go to a terminal and run the following command to see if it actually kicked off the process.

ps -ef | grep guard

On my box when I run the above I see the following output:

501 88486 88460   0  1:36AM ??         0:00.13 python /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/guard_wrapper /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/run_guard.sh /Users/adeponte/WebApps/realpractice/rpp_web_app
501 88487 88486   0  1:36AM ??         0:00.11 /bin/sh /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/run_guard.sh /Users/adeponte/WebApps/realpractice/rpp_web_app
501 88888 88487   0  1:36AM ??         0:01.94 ruby /Users/adeponte/.rvm/gems/ruby-1.9.3-p0@rpp_web_app/bin/guard

If it is running for you, you should see something similar. If it is either not running or you see something vastly different please let me know and provide any info you can.

Are you using rb-readline to provide readline support to Guard. If so I have yet to test my plugin with that so I am not sure if that works or not. It would be something to try to disable if you are using it. Anyways, let me know what your results are. If they are still bad then I will try and think of a better way to get more debugging information out.

Owner

cyphactor commented Feb 8, 2012

@ticktricktrack I just upgraded one of my apps to use guard 1.0.0 and I am having no problem with it. I am on the following:

OS X fully updated
ruby 1.9.3 in an rvm gemset
guard 1.0.0
Sublime Text 2 Dev Builds, Build 2175 (I used to use 2165 and it worked with my plugin)

To help figure out what is going on exactly I recommend that you run "Start Guard" from Sublime Text 2 and then go to a terminal and run the following command to see if it actually kicked off the process.

ps -ef | grep guard

On my box when I run the above I see the following output:

501 88486 88460   0  1:36AM ??         0:00.13 python /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/guard_wrapper /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/run_guard.sh /Users/adeponte/WebApps/realpractice/rpp_web_app
501 88487 88486   0  1:36AM ??         0:00.11 /bin/sh /Users/adeponte/Library/Application Support/Sublime Text 2/Packages/Guard/run_guard.sh /Users/adeponte/WebApps/realpractice/rpp_web_app
501 88888 88487   0  1:36AM ??         0:01.94 ruby /Users/adeponte/.rvm/gems/ruby-1.9.3-p0@rpp_web_app/bin/guard

If it is running for you, you should see something similar. If it is either not running or you see something vastly different please let me know and provide any info you can.

Are you using rb-readline to provide readline support to Guard. If so I have yet to test my plugin with that so I am not sure if that works or not. It would be something to try to disable if you are using it. Anyways, let me know what your results are. If they are still bad then I will try and think of a better way to get more debugging information out.

@ticktricktrack

This comment has been minimized.

Show comment
Hide comment
@ticktricktrack

ticktricktrack Feb 8, 2012

Sorry, shows no running guard processes

ps -ef | grep guard 
501  3370   412   0 12:17pm ttys000    0:00.00 grep guard

I do not use rb-readline, although the brew readline libs are compiled into my rvm ruby

Sorry, shows no running guard processes

ps -ef | grep guard 
501  3370   412   0 12:17pm ttys000    0:00.00 grep guard

I do not use rb-readline, although the brew readline libs are compiled into my rvm ruby

@dagobar

This comment has been minimized.

Show comment
Hide comment
@dagobar

dagobar Feb 8, 2012

I have the same issue under Ubuntu too, looking at the console when trying to run the start guard command gives:

Traceback (most recent call last):
File "./sublime_plugin.py", line 327, in run_
File "./guard.py", line 153, in run
File "./guard.py", line 51, in start_guard
File ".\subprocess.py", line 633, in init
File ".\subprocess.py", line 1139, in _execute_child
OSError: [Errno 13] Permission denied

if that is any help?

dagobar commented Feb 8, 2012

I have the same issue under Ubuntu too, looking at the console when trying to run the start guard command gives:

Traceback (most recent call last):
File "./sublime_plugin.py", line 327, in run_
File "./guard.py", line 153, in run
File "./guard.py", line 51, in start_guard
File ".\subprocess.py", line 633, in init
File ".\subprocess.py", line 1139, in _execute_child
OSError: [Errno 13] Permission denied

if that is any help?

@ticktricktrack

This comment has been minimized.

Show comment
Hide comment
@ticktricktrack

ticktricktrack Feb 8, 2012

Thanks dagobar, I didn't even think about looking into the Sublime Console.

meaningfull output, same as dagobars

Checking ... /Users/rainerkuhn/work
Traceback (most recent call last):
  File "./sublime_plugin.py", line 328, in run_
  File "./guard.py", line 153, in run
  File "./guard.py", line 51, in start_guard
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

Thanks dagobar, I didn't even think about looking into the Sublime Console.

meaningfull output, same as dagobars

Checking ... /Users/rainerkuhn/work
Traceback (most recent call last):
  File "./sublime_plugin.py", line 328, in run_
  File "./guard.py", line 153, in run
  File "./guard.py", line 51, in start_guard
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 8, 2012

Owner

Very interesting... @dagobar, @ticktricktrack The line of code in the plugin that is throwing that error is the following:

self.proc = subprocess.Popen(cmd_array, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

The cmd_array just specifies the command to run and its arguments. The command path that it runs is as follows

~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper

I am not sure why you wouldn't have perms to execute this command. I looked at the code and currently it only has execute privs on the guard_wrapper and run_guard.sh commands for the owner. So, if for some reason the user that installed the plugin is a different user than the one running Sublime Text 2 that could be the problem. Please run the following commands and reply with the output.

whoami
ls -l ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper
ls -l ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/run_guard.sh

The above will show you who you are currently logged in as as well as the permissions on the two scripts that it runs so we can see if the issue is ownership, or somehow general perms, or what not.

Owner

cyphactor commented Feb 8, 2012

Very interesting... @dagobar, @ticktricktrack The line of code in the plugin that is throwing that error is the following:

self.proc = subprocess.Popen(cmd_array, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

The cmd_array just specifies the command to run and its arguments. The command path that it runs is as follows

~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper

I am not sure why you wouldn't have perms to execute this command. I looked at the code and currently it only has execute privs on the guard_wrapper and run_guard.sh commands for the owner. So, if for some reason the user that installed the plugin is a different user than the one running Sublime Text 2 that could be the problem. Please run the following commands and reply with the output.

whoami
ls -l ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper
ls -l ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/run_guard.sh

The above will show you who you are currently logged in as as well as the permissions on the two scripts that it runs so we can see if the issue is ownership, or somehow general perms, or what not.

@dagobar

This comment has been minimized.

Show comment
Hide comment
@dagobar

dagobar Feb 9, 2012

$ whoami
ben
$ ls -l ~/.config/sublime-text-2/Packages/Guard/guard_wrapper
-rw-rw-r-- 1 ben ben 2350 2012-02-07 15:15 guard_wrapper
$ ls -l ~/.config/sublime-text-2/Packages/Guard/run_guard.sh
-rw-rw-r-- 1 ben ben 2717 2012-02-07 15:15 run_guard.sh

*my Sublime is stored in a different location
I hope this helps ... do they both need to be executable?

dagobar commented Feb 9, 2012

$ whoami
ben
$ ls -l ~/.config/sublime-text-2/Packages/Guard/guard_wrapper
-rw-rw-r-- 1 ben ben 2350 2012-02-07 15:15 guard_wrapper
$ ls -l ~/.config/sublime-text-2/Packages/Guard/run_guard.sh
-rw-rw-r-- 1 ben ben 2717 2012-02-07 15:15 run_guard.sh

*my Sublime is stored in a different location
I hope this helps ... do they both need to be executable?

@dagobar

This comment has been minimized.

Show comment
Hide comment
@dagobar

dagobar Feb 9, 2012

I think I've solved it, for me at least.

I made both run_gaurd.sh and guard_wrapper executable (chmod +x)
This then got further but it grumbled with:

/home/ben/.config/sublime-text-2/Packages/Guard/run_guard.sh: 12: Syntax error: "(" unexpected

I change the first line of run_guard.sh to #!/bin/bash instead of #!/bin/sh and that solved the problem :)

Now to read up on how to get coloured output.

dagobar commented Feb 9, 2012

I think I've solved it, for me at least.

I made both run_gaurd.sh and guard_wrapper executable (chmod +x)
This then got further but it grumbled with:

/home/ben/.config/sublime-text-2/Packages/Guard/run_guard.sh: 12: Syntax error: "(" unexpected

I change the first line of run_guard.sh to #!/bin/bash instead of #!/bin/sh and that solved the problem :)

Now to read up on how to get coloured output.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 9, 2012

Owner

@dagobar yep that seems to be the issue. For some reason those scripts didn't get the execute priv when the plugin got installed. I am looking into how Git handles file permissions in more detail since Git is the software delivery mechanism.

You should be able to manually resolve the problem by running the following @dagobar:

chmod u+x ~/.config/sublime-text-2/Packages/Guard/guard_wrapper
chmod u+x ~/.config/sublime-text-2/Packages/Guard/run_guard.sh

@ticktricktrack I am suspecting that you should be able to run two similar commands to the above but with the following paths to manually fix it.

~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/run_guard.sh

Please let me know what your results are with doing this manual work around.

Owner

cyphactor commented Feb 9, 2012

@dagobar yep that seems to be the issue. For some reason those scripts didn't get the execute priv when the plugin got installed. I am looking into how Git handles file permissions in more detail since Git is the software delivery mechanism.

You should be able to manually resolve the problem by running the following @dagobar:

chmod u+x ~/.config/sublime-text-2/Packages/Guard/guard_wrapper
chmod u+x ~/.config/sublime-text-2/Packages/Guard/run_guard.sh

@ticktricktrack I am suspecting that you should be able to run two similar commands to the above but with the following paths to manually fix it.

~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/guard_wrapper
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Guard/run_guard.sh

Please let me know what your results are with doing this manual work around.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 9, 2012

Owner

@dagobar awesome glad to hear that the workaround worked for you. I will continue to investigate what the issue is with the execute privs not carrying over on install. Oh, and thx for the sh-bang notice. I will replace it with bash instead of sh as it seems pretty damn standard at this point.

Owner

cyphactor commented Feb 9, 2012

@dagobar awesome glad to hear that the workaround worked for you. I will continue to investigate what the issue is with the execute privs not carrying over on install. Oh, and thx for the sh-bang notice. I will replace it with bash instead of sh as it seems pretty damn standard at this point.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 9, 2012

Owner

@dagobar I just pushed the sh-bang fix you mentioned above so you should be able to run the following to get the updated version of plugin.

cd ~/.config/sublime-text-2/Packages/Guard/
git reset --hard
git pull

Let me know if you have any issues.

Owner

cyphactor commented Feb 9, 2012

@dagobar I just pushed the sh-bang fix you mentioned above so you should be able to run the following to get the updated version of plugin.

cd ~/.config/sublime-text-2/Packages/Guard/
git reset --hard
git pull

Let me know if you have any issues.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 9, 2012

Owner

@dagobar, @ticktricktrack, so I did a bit of digging into Git and my initial assumption was correct in that Git does store the filemodes (a.k.a. file perms) in the index. However, it seems there is a git config option in core called filemode which can be set to a boolean value and is used to control if Git should ignore the differences between the index recorded filemodes and the working directories filemodes.

I investigated my environment with the following command:

git config core.filemode
true

As you can see from the above my setup has a value of true which tells Git to care about the filemodes. I have my entire dev team at RealPractice, Inc. using this plugin on their Mac OS X machines and none of them have had this issue. So, at this point I am guessing that both you @dagobar and @ticktricktrack must have the core.filemode option set to false. Would you both please verify if this is true or not using the following command:

git config core.filemode

If this is not the case for you then I am back to the drawing board looking for ideas as to why the perms would not be carried over.

Owner

cyphactor commented Feb 9, 2012

@dagobar, @ticktricktrack, so I did a bit of digging into Git and my initial assumption was correct in that Git does store the filemodes (a.k.a. file perms) in the index. However, it seems there is a git config option in core called filemode which can be set to a boolean value and is used to control if Git should ignore the differences between the index recorded filemodes and the working directories filemodes.

I investigated my environment with the following command:

git config core.filemode
true

As you can see from the above my setup has a value of true which tells Git to care about the filemodes. I have my entire dev team at RealPractice, Inc. using this plugin on their Mac OS X machines and none of them have had this issue. So, at this point I am guessing that both you @dagobar and @ticktricktrack must have the core.filemode option set to false. Would you both please verify if this is true or not using the following command:

git config core.filemode

If this is not the case for you then I am back to the drawing board looking for ideas as to why the perms would not be carried over.

@metakeule

This comment has been minimized.

Show comment
Hide comment
@metakeule

metakeule Feb 9, 2012

chmod u+x 

fixed it for me, too.

git config core.filemode

returns

true

(Ubuntu 11.10)

chmod u+x 

fixed it for me, too.

git config core.filemode

returns

true

(Ubuntu 11.10)

@dagobar

This comment has been minimized.

Show comment
Hide comment
@dagobar

dagobar Feb 9, 2012

git config core.filemode
true

Although the Guard/ directory didn't have a git repo in it which struck me as a bit strange- I had to initialize an empty one to run the command?

dagobar commented Feb 9, 2012

git config core.filemode
true

Although the Guard/ directory didn't have a git repo in it which struck me as a bit strange- I had to initialize an empty one to run the command?

@ticktricktrack

This comment has been minimized.

Show comment
Hide comment
@ticktricktrack

ticktricktrack Feb 9, 2012

chmod u+x did it for me too, thank you so much

chmod u+x did it for me too, thank you so much

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 9, 2012

Owner

Ah, one thing I didn't realize is that you guys installed the plugin from Package Control. I just tested doing a fresh installed from Git manually and it carries the perms over correctly. Then I nuked it and did a fresh install via Package Control and for some reason it didn't include the file permissions.

Owner

cyphactor commented Feb 9, 2012

Ah, one thing I didn't realize is that you guys installed the plugin from Package Control. I just tested doing a fresh installed from Git manually and it carries the perms over correctly. Then I nuked it and did a fresh install via Package Control and for some reason it didn't include the file permissions.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 10, 2012

Owner

I need to do some digging and figure out how to get Package Control to include file permissions when it does the install.

Owner

cyphactor commented Feb 10, 2012

I need to do some digging and figure out how to get Package Control to include file permissions when it does the install.

@cyphactor

This comment has been minimized.

Show comment
Hide comment
@cyphactor

cyphactor Feb 10, 2012

Owner

@ticktricktrack, @metakeule, @dagobar I have released a new version of plugin that resolves this issue.

If you have manually installed the plugin using Git then you should follow the directions in the README to upgrade the plugin.

If you installed this plugin via Package Control which is most likely the case if you are having this issue you should simply need to Quit Sublime Text 2 and start it up again to have Package Control grab the latest version for you.

If you are still having problems or you have manually changed your installed version of the Guard plugin then it is probably your safest bet to uninstall the Guard plugin via the Package Control: Remove Package command and then to re-install it via Package Control using the Package Control: Install Package command.

As I am very confident my latest version resolves this issue I am going to close this ticket. Please comment on this issue anyways to let me know if it resolved the issue for you. Also, that will allow other users that may be having this issue know that it is a valid fix.

If you have any issues either related to this or something else please feel free to create a new issues or reopen this one.

Owner

cyphactor commented Feb 10, 2012

@ticktricktrack, @metakeule, @dagobar I have released a new version of plugin that resolves this issue.

If you have manually installed the plugin using Git then you should follow the directions in the README to upgrade the plugin.

If you installed this plugin via Package Control which is most likely the case if you are having this issue you should simply need to Quit Sublime Text 2 and start it up again to have Package Control grab the latest version for you.

If you are still having problems or you have manually changed your installed version of the Guard plugin then it is probably your safest bet to uninstall the Guard plugin via the Package Control: Remove Package command and then to re-install it via Package Control using the Package Control: Install Package command.

As I am very confident my latest version resolves this issue I am going to close this ticket. Please comment on this issue anyways to let me know if it resolved the issue for you. Also, that will allow other users that may be having this issue know that it is a valid fix.

If you have any issues either related to this or something else please feel free to create a new issues or reopen this one.

@cyphactor cyphactor closed this Feb 10, 2012

@skotzko

This comment has been minimized.

Show comment
Hide comment
@skotzko

skotzko Oct 29, 2014

@cyphactor I'm getting this same error in ST3 on Yosemite. Installed via Package Control. I tried uninstalling/reinstalling via Package Control, and restarting ST3 after install to no avail.

Error I'm getting when I run Guard: Start Guard is:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 526, in run_
    return self.run()
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 210, in run
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 76, in start_guard
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 68, in set_permissions
FileNotFoundError: [Errno 2] No such file or directory: '/Users/andrew/Library/Application Support/Sublime Text 3/Packages/Guard/guard_wrapper'

I checked, and true enough, when installing via Package Control, Guard did not create a folder for itself under .../Sublime Text 3/Packages.

skotzko commented Oct 29, 2014

@cyphactor I'm getting this same error in ST3 on Yosemite. Installed via Package Control. I tried uninstalling/reinstalling via Package Control, and restarting ST3 after install to no avail.

Error I'm getting when I run Guard: Start Guard is:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 526, in run_
    return self.run()
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 210, in run
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 76, in start_guard
  File "guard in /Users/andrew/Library/Application Support/Sublime Text 3/Installed Packages/Guard.sublime-package", line 68, in set_permissions
FileNotFoundError: [Errno 2] No such file or directory: '/Users/andrew/Library/Application Support/Sublime Text 3/Packages/Guard/guard_wrapper'

I checked, and true enough, when installing via Package Control, Guard did not create a folder for itself under .../Sublime Text 3/Packages.

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